diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/packrat-lexer.ads | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/packrat-lexer.ads b/src/packrat-lexer.ads index 382b7ff..fe5ff9d 100644 --- a/src/packrat-lexer.ads +++ b/src/packrat-lexer.ads @@ -1,5 +1,10 @@ +private with + + Ada.Containers.Vectors; + + generic type Label_Enum is (<>); @@ -276,9 +281,24 @@ private - type Lexer_Context is new Ada.Finalization.Controlled with null record; + package Token_Vectors is new Ada.Containers.Vectors + (Index_Type => Positive, + Element_Type => Gen_Tokens.Token, + "=" => Gen_Tokens."="); - Empty_Context : constant Lexer_Context := (Ada.Finalization.Controlled with null record); + type Lexer_Context is new Ada.Finalization.Controlled with record + Result_So_Far : Token_Vectors.Vector; + Position : Positive; + Status : Result_Status; + Pass_Forward : Element_Array_Access; + end record; + + Empty_Context : constant Lexer_Context := + (Ada.Finalization.Controlled with + Result_So_Far => Token_Vectors.Empty_Vector, + Position => 1, + Status => Success, + Pass_Forward => null); end Packrat.Lexer; |