From 5a01394fadfe73cc9bfdc3576a58ac3cd4dcb1f2 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Mon, 14 Jan 2019 19:03:33 +1100 Subject: Implemented details of Lexer_Context type --- src/packrat-lexer.ads | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit