Top Prev Next Up Down

Y2018.Text.Jets.JetsTool


001| with Ada.Containers.Vectors;
002| with Ada.Finalization; use Ada.Finalization;
003| with Y2018.Text.Jets; use Y2018.Text.Jets;
004| with Y2018.Text.Jets.RangeVectorPack;
005| with Y2018.Text.Core; use Y2018.Text.Core;
006| with Y2018.Text.Core.CVarPack; use Y2018.Text.Core.CVarPack;
007| with Y2018.Text.Core.Str; use Y2018.Text.Core.Str;
008| package Y2018.Text.Jets.JetsTool is
009| __subtype RE_ID is Integer range 0 .. Integer'Last;
010| __NO_RE_ID: constant RE_ID := 0;
011| __FIRST_RE_ID: constant RE_ID := 1;
012| __type RE_Elem;
013| __type RE_Elem_AC is access RE_Elem;
014| __type RE_ARR is array(Integer range <>) of RE_Elem_AC;
015| __package CHAR_PERIOD_CLASS_Vector_TY is new Ada.Containers.Vectors(Natural,RE_Elem_AC);
016| __type RE_Elem (V : REQ_TY) is
017| __record
018| _____id : RE_ID;
019| _____left : RE_Elem_AC;
020| _____right : RE_Elem_AC;
021| _____char_period_class_vector:CHAR_PERIOD_CLASS_Vector_TY.Vector; -- default CHAR_PERIOD_CLASS_Vector_TY.Empty_Vector, contains nodes of type REQ_CHAR. REQ_PERIOD, REQ_CLASS
022| _____case V is
023| ________when REQ_BEGIN =>
024| ___________begin_circumflex : Boolean;
025| ___________begin_dollar : Boolean;
026| ________when REQ_CHAR =>
027| ___________char_value : CodePoint;
028| ___________char_negative : Boolean;
029| ___________char_min : Integer; -- 0:Integer'Last
030| ___________char_max : Integer;
031| ___________char_maxORG : Integer;
032| ___________char_greedy : Boolean;
033| ________when REQ_PERIOD =>
034| ___________period_min : Integer; -- 0:Integer'Last
035| ___________period_max : Integer;
036| ___________period_maxORG : Integer;
037| ___________period_greedy : Boolean;
038| ________when REQ_CLASS_ELEM => -- Do not exists in RegexPattern
039| ___________class_elem_min : Integer; -- 0:Integer'Last
040| ___________class_elem_max : Integer;
041| ___________class_elem_greedy : Boolean;
042| ___________class_elem_pos : RE_Elem_AC;
043| ___________class_elem_neg : RE_Elem_AC;
044| ________when REQ_CLASS => -- Exists only in RegexPattern
045| ___________class_min : Integer; -- 0:Integer'Last
046| ___________class_max : Integer;
047| ___________class_maxORG : Integer;
048| ___________class_greedy : Boolean;
049| ___________class_pos : RangeVectorPack.RangeVector;
050| ___________class_neg : RangeVectorPack.RangeVector;
051| ________when REQ_CLASS_CHAR => -- Do not exists in RegexPattern
052| ___________class_char_negative : Boolean;
053| ___________class_char_value : CodePoint; -- no meta characters
054| ________when REQ_CLASS_RANGE => -- Do not exists in RegexPattern
055| ___________class_range_negative : Boolean;
056| ___________class_range_first : CodePoint;
057| ___________class_range_last : CodePoint;
058| ________when REQ_CLASS_GC => -- Do not exists in RegexPattern
059| ___________class_gc_negative : Boolean;
060| ___________class_gc_value : CFix(1..2);
061| ________when REQ_CLASS_GCU => -- Do not exists in RegexPattern
062| ___________class_gcu_negative : Boolean;
063| ___________class_gcu_value : CodePoint;
064| ________when REQ_CLASS_SET => -- Do not exists in RegexPattern
065| ___________class_set_negative : Boolean;
066| ___________class_set_value : CVar;
067| ________when REQ_CLASS_OTHER => -- Do not exists in RegexPattern
068| ___________class_other_negative : Boolean;
069| ___________class_other_value : CodePoint;
070| ________when REQ_PALCAP => -- ( )
071| ___________palcap_min : Integer; -- 0:Integer'Last
072| ___________palcap_max : Integer;
073| ___________palcap_greedy : Boolean;
074| ___________palcap_up : RE_Elem_AC; -- null if on base line
075| ___________palcap_down : RE_Elem_AC;
076| ___________palcap_ia:I_A;
077| ________when REQ_PAL => -- (?: )
078| ___________pal_dummy: Boolean;
079| ___________pal_min : Integer; -- 0:Integer'Last
080| ___________pal_max : Integer;
081| ___________pal_greedy : Boolean;
082| ___________pal_up : RE_Elem_AC; -- null if on base line
083| ___________pal_down : RE_Elem_AC;
084| ________when REQ_UPDOWN =>
085| ___________updown_up : RE_Elem_AC; -- null if on base line
086| ___________updown_down : RE_Elem_AC;
087| ________when REQ_POS =>
088| ___________pos_up : RE_Elem_AC; -- null if on base line
089| ___________pos_down : RE_Elem_AC;
090| ________when REQ_NEG =>
091| ___________neg_up : RE_Elem_AC; -- null if on base line
092| ___________neg_down : RE_Elem_AC;
093| ________when REQ_NULL => -- ** Do not exists **
094| ___________null_dummy: Boolean;
095| _____end case;
096| __end record;
097| __type Pool_TY is new Controlled with
098| _____record
099| ________root: RE_Elem_AC;
100| _____end record;
101| __procedure JesTool_Finalize(pool : in out Pool_TY);
102| __procedure RE_ELEM_FreeNode(y:in out RE_Elem_AC);
103| __subtype MatchID is Integer range 0 .. Integer'Last;
104| __NO_MatchID: constant MatchID :=Integer'Last;
105| __function CREATE_RE(id:in out RE_ID;reqv: REQ_TY) return RE_ELEM_AC;
106| __function CREATE_RE(id:in out RE_ID;reqv: REQ_TY;vleft:RE_Elem_AC) return RE_ELEM_AC;
107| __function CREATE_RE(id:in out RE_ID;reqv: REQ_TY;vleft:RE_Elem_AC;vup:RE_Elem_AC) return RE_ELEM_AC;
108| __procedure Init_RE(y :in out RE_ELEM_AC);
109| __function getMin(this:RE_Elem_AC;default:Boolean:=FALSE) return Integer;
110| __function getMax(this:RE_Elem_AC;default:Boolean:=FALSE) return Integer;
111| __function getGreedy(this:RE_Elem_AC) return TRINITY;
112| __function New_RangeVector(actual:RE_Elem_AC;urv:RangeVectorPack.Map_TY.Map) return RangeVectorPack.RangeVector;
113| __function To_String(currRE: RE_Elem_AC) return String;
114| __procedure To_CList(Qmap:in out CList.map;y: RE_Elem_AC;cntMax:Integer:=10;extend:Boolean:=FALSE);
115| __function Who(currRE: RE_Elem_AC) return String;
116| __function To_CVar(s : CFix;Low:Integer;High:Integer) return CVar;
117| __function isInMCHAR(c:CodePoint) return Boolean;
118| __function ParseStringM(s:CFix) return Integer; -- not needed in Jets. Based on single back-slash
119| __function QuoteMetaM(s:CFix) return CFix; -- not needed in Jets.
120| end Y2018.Text.Jets.JetsTool;