summaryrefslogtreecommitdiff
path: root/src/packrat-lexer.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/packrat-lexer.ads')
-rw-r--r--src/packrat-lexer.ads46
1 files changed, 6 insertions, 40 deletions
diff --git a/src/packrat-lexer.ads b/src/packrat-lexer.ads
index 0cd5c78..693064d 100644
--- a/src/packrat-lexer.ads
+++ b/src/packrat-lexer.ads
@@ -29,7 +29,7 @@ package Packrat.Lexer is
- type Lexer_Context is new Ada.Finalization.Controlled with private;
+ type Lexer_Context is private;
Empty_Context : constant Lexer_Context;
@@ -263,26 +263,16 @@ private
Element_Type => Gen_Tokens.Token,
"=" => Gen_Tokens."=");
-
-
-
- type Element_Array_Access is access all Element_Array;
-
- Empty_Array : Element_Array (1 .. 0);
-
-
-
-
package Label_Vectors is new Ada.Containers.Vectors
(Index_Type => Positive,
Element_Type => Label_Enum);
-
-
-
package Label_Sets is new Ada.Containers.Ordered_Sets
(Element_Type => Label_Enum);
+ package Input_Holders is new Ada.Containers.Indefinite_Holders
+ (Element_Type => Element_Array);
+
@@ -308,48 +298,24 @@ private
Position : Positive;
Offset : Natural;
Status : Result_Status;
- Pass_Forward : Element_Array_Access;
+ Pass_Forward : Input_Holders.Holder;
Empty_Labels : Label_Sets.Set;
Error_Labels : Label_Vectors.Vector;
Allow_Incomplete : Boolean;
end record;
- overriding procedure Initialize
- (This : in out Lexer_Context);
-
- overriding procedure Adjust
- (This : in out Lexer_Context);
-
- overriding procedure Finalize
- (This : in out Lexer_Context);
-
Empty_Context : constant Lexer_Context :=
(Ada.Finalization.Controlled with
Result_So_Far => Token_Vectors.Empty_Vector,
Position => 1,
Offset => 0,
Status => Success,
- Pass_Forward => null,
+ Pass_Forward => Input_Holders.Empty_Holder,
Empty_Labels => Label_Sets.Empty_Set,
Error_Labels => Label_Vectors.Empty_Vector,
Allow_Incomplete => True);
-
-
- type Input_Container is new Ada.Finalization.Limited_Controlled with record
- Data : Element_Array_Access;
- Dealloc : Boolean;
- end record;
-
- overriding procedure Finalize
- (This : in out Input_Container);
-
- function Pass_Input
- (Passed, Continuing : in Element_Array_Access)
- return Input_Container;
-
-
end Packrat.Lexer;