Top Prev Next Up Down

Y2018.Text.Jets

Jets is the parent package for regular expression handling

001| with Y2018.Text.Core; use Y2018.Text.Core;
002| with Y2018.Text.Core.Str; use Y2018.Text.Core.Str;
003| with Y2018.Text.Core.CVarPack; use Y2018.Text.Core.CVarPack;
004| package Y2018.Text.Jets is
005| __type I_A is array (1..2) of Integer;
006| __type I_A_ARRAY is Array(Integer range <>) of I_A;
007| __type MCHAR_AR is Array(Integer range <>) of CodePoint;
008| __W_BACKSLASH: constant CodePoint:= CodePoint'Val(16#5C#); --\
009| __I_A_NO_ELEMENT : constant I_A:=(-1,0);
010| __W_VERTICAL_LINE:constant CodePoint:=CodePoint'Val(16#7C#); --'|'
011| __W_LEFT_PARENTESIS:constant CodePoint:=CodePoint'Val(16#28#); --'('
012| __W_LEFT_QUARE_BRACKET:constant CodePoint:=CodePoint'Val(16#5B#); --'['
013| __W_CIRCUMFLEX_ACCENT:constant CodePoint:=CodePoint'Val(16#5E#); --'^'
014| __W_DOLLAR_SIGN:constant CodePoint:=CodePoint'Val(16#24#); --'$'
015| __W_PERIOD:constant CodePoint:=CodePoint'Val(16#2E#); --'.'
016| __W_RIGHT_PARENTESIS:constant CodePoint:=CodePoint'Val(16#29#); --')'
017| __W_QUESTION_MARK:constant CodePoint:=CodePoint'Val(16#3F#); --'?'
018| __W_COLON:constant CodePoint:=CodePoint'Val(16#3A#);--':'
019| __W_LEFT_CURLY_BRACKET:constant CodePoint:=CodePoint'Val(16#7B#);--'{'
020| __W_ASTERISK:constant CodePoint:=CodePoint'Val(16#2A#);--'*'
021| __W_PLUS_SIGN:constant CodePoint:=CodePoint'Val(16#2B#);--'+'
022| __W_DIGIT_ZERO:constant CodePoint:=CodePoint'Val(16#30#);--'0'
023| __W_DIGIT_NINE:constant CodePoint:=CodePoint'Val(16#39#);--'9'
024| __W_RIGHT_SQUARE_BRACKET:constant CodePoint:=CodePoint'Val(16#5D#);--']'
025| __W_RIGHT_CURLY_BRACKET:constant CodePoint:=CodePoint'Val(16#7D#);--'}'
026| __W_LATIN_CAPITAL_LETTER_D:constant CodePoint:=CodePoint'Val(16#44#);--'D'
027| __W_LATIN_SMALL_LETTER_D:constant CodePoint:=CodePoint'Val(16#64#);--'d'
028| __W_LATIN_CAPITAL_LETTER_P:constant CodePoint:=CodePoint'Val(16#50#);--'P'
029| __W_LATIN_SMALL_LETTER_P:constant CodePoint:=CodePoint'Val(16#70#);--'p'
030| __W_LATIN_CAPITAL_LETTER_S:constant CodePoint:=CodePoint'Val(16#53#);--'S'
031| __W_LATIN_SMALL_LETTER_S:constant CodePoint:=CodePoint'Val(16#73#);--'s'
032| __W_LATIN_CAPITAL_LETTER_W:constant CodePoint:=CodePoint'Val(16#57#);--'W'
033| __W_LATIN_SMALL_LETTER_W:constant CodePoint:=CodePoint'Val(16#77#);--'w'
034| __W_MINUS:constant CodePoint:=CodePoint'Val(16#2D#);--'-'
035| __MCHAR:constant MCHAR_AR:=(W_VERTICAL_LINE,W_LEFT_PARENTESIS,W_RIGHT_PARENTESIS,W_LEFT_QUARE_BRACKET,W_RIGHT_SQUARE_BRACKET,W_LEFT_CURLY_BRACKET,
036| ______W_RIGHT_CURLY_BRACKET,W_CIRCUMFLEX_ACCENT,W_DOLLAR_SIGN,W_ASTERISK,W_PLUS_SIGN,W_QUESTION_MARK,W_PERIOD); -- W_MINUS cannot be one of theese
037| __type REQ_TY is (REQ_BEGIN, REQ_CHAR, REQ_PERIOD, REQ_CLASS_ELEM, REQ_CLASS,
038| ____________REQ_PALCAP, REQ_PAL, REQ_UPDOWN, REQ_CLASS_CHAR, REQ_CLASS_RANGE,
039| ____________REQ_CLASS_GC, REQ_CLASS_GCU, REQ_CLASS_SET, REQ_CLASS_OTHER,
040| ____________REQ_POS, REQ_NEG, REQ_NULL);
041| __function subIA(value:CFix;a:I_A) return CFix;
042| __function subIA(value:String;a:I_A) return String;
043| __function subIA(value:CVar;a:I_A) return CVar;
044| __function To_String(ia:I_A) return String;
045| end Y2018.Text.Jets;
046| __

Subpackages:
Allmost all work is done through the subpackages
  1. Definitions of I_A type and functions and constants based on this type
  2. Reserved characters in a regular expression and backslash, ( |, (, ), [, ], {, }, ^, $, *, +, ?, ., - , \ ) and grouping characters when followed by backslash
  3. REQ_TY type, used by the type RE_Elem definition as a qualifier of different type of nodes in the syntax tree.