Top Prev Next Up Down 
    The PatternPack
    
    The three mains in the package:
    
    
      - compileM for compiling the regular expression (s-parameter) to
        a syntax three of RE_ELEM objects
       
      
        - procedure compileM(ptc:in out Pattern_AC;s :
          CFix;urv:RangeVectorPack.Map_TY.Map:=RangeVectorPack.Map_TY.Empty_Map);
 
        - function compileM(s :
          CFix;urv:RangeVectorPack.Map_TY.Map:=RangeVectorPack.Map_TY.Empty_Map)
          return Pattern_AC;
 
      
      - compileU for compiling the regular expression (s-parameter) to
        a syntax three of RE_ELEM objects but
          after converting data to upper case, alltough the
        s-parameter is input only and the conversion is done only
        internally.
       
      
        - procedure compileU(ptc:in out Pattern_AC;s :
          CFix;urv:RangeVectorPack.Map_TY.Map:=RangeVectorPack.Map_TY.Empty_Map);
 
        - function compileU(s :
          CFix;urv:RangeVectorPack.Map_TY.Map:=RangeVectorPack.Map_TY.Empty_Map)
          return Pattern_AC;
 
      
      - function
        matches(pattern:Pattern_AC;startPos:Integer;nextPos:out
        Integer;c4match : CFix;match: out
        MatchPack.Match_TY;squ:Integer:=0) return Boolean;
 
    
    Two versions for the compilation, one as a procedure call and the
      second as a function. The declaration of the package in the
      ads-file y2018.text.jets.patternpack.html.
      Function matches is a wrapper for Matchpack
      for retreiving the results to the Patternpack object.
    
    Example when using the procedure approach ExPsi.adb. The code in ExPsi.adb must be
      precompiled and compiled.
      Comments about the code in ExPsi.adb:
    
    
      - Line 019 : call of compileM - we do not use the 'uppercase'
        version
       
      - Line 020 : match the text "ExPsi procedure" (sourcevalue).
       
      - line 022 : create the result array 'r' (I_A_ARRAY(0 ..
        MatchPack.size(m) - 1);)
 
      - line 024 : initiate 'r' array from the variable 'm'
 
    
    Example when using the function approach ExYpsilon.adb. The code in ExYpsilon.adb must
    be precompiled and compiled.
    Comments about the code in ExYpsilon.adb:
    
      - Line 010 : call of compileM - we do not use the 'uppercase'
        version
       
      - Line 017 : match the text "Huey, Dewey, Louie, Duck" (line).
       
      - line 019 : create the result array 'r'
        (I_A_ARRAY:=MatchPack.getMatch(m);)
 
    
    A shorter version ?
    
    What is this default "urv:RangeVectorPack.Map_TY.Map:=RangeVectorPack.Map_TY.Empty_Map"
    ? It says that extending of the '\p' is not
    used in this compilation, only 'mapPool' which is used is the
    default with General categories and \d \D, \s \S and \w \W .
    What is "squ" ?
     function
      matches(pattern:Pattern_AC;startPos:Integer;nextPos:out
      Integer;c4match : CFix;match: out MatchPack.Match_TY;squ:Integer:=0) return Boolean;
    In some cases the pattern of a regular expression can still be fit
    if we decrease found codepoints where a variable amount. Value squ
    (short for squeeze) says the amount of times we can try. The fitting
    process is experimental form of backtracking but can
    be useful.
    As an example see ExLamda. In this case we
    squeeze the value of r(1) with one for a value in r(2), the digit
    '9'.