summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/packrat-tokens.adb27
-rw-r--r--src/packrat-tokens.ads19
2 files changed, 46 insertions, 0 deletions
diff --git a/src/packrat-tokens.adb b/src/packrat-tokens.adb
index c07408c..81d68c3 100644
--- a/src/packrat-tokens.adb
+++ b/src/packrat-tokens.adb
@@ -111,6 +111,33 @@ package body Packrat.Tokens is
end Value;
+
+
+
+ function Is_Label
+ (This : in Token)
+ return Boolean is
+ begin
+ return This.Identifier = Ident;
+ end Is_Label;
+
+
+ function Is_Start
+ (This : in Token)
+ return Boolean is
+ begin
+ return This.Start_At = Start;
+ end Is_Start;
+
+
+ function Is_Value
+ (This : in Token)
+ return Boolean is
+ begin
+ return This.Token_Value.Element = Value;
+ end Is_Value;
+
+
end Packrat.Tokens;
diff --git a/src/packrat-tokens.ads b/src/packrat-tokens.ads
index cd691b5..b731b13 100644
--- a/src/packrat-tokens.ads
+++ b/src/packrat-tokens.ads
@@ -60,6 +60,25 @@ package Packrat.Tokens is
return Element_Array;
+ generic
+ Ident : in Label_Enum;
+ function Is_Label
+ (This : in Token)
+ return Boolean;
+
+ generic
+ Start : in Positive;
+ function Is_Start
+ (This : in Token)
+ return Boolean;
+
+ generic
+ Value : in Element_Array;
+ function Is_Value
+ (This : in Token)
+ return Boolean;
+
+
private