summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2019-01-14 19:03:33 +1100
committerJed Barber <jjbarber@y7mail.com>2019-01-14 19:03:33 +1100
commit5a01394fadfe73cc9bfdc3576a58ac3cd4dcb1f2 (patch)
treeaf359ceafee1b8e1dc7d37c9027ac941c2b37ad0 /src
parentc0ba281a0bf3edc564a4fee61375691f35632be4 (diff)
Implemented details of Lexer_Context type
Diffstat (limited to 'src')
-rw-r--r--src/packrat-lexer.ads24
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;