Top Prev Next Up Down

The PatternPack

The three mains in the package:

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:

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:
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'.