summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/sentence.adb23
1 files changed, 12 insertions, 11 deletions
diff --git a/example/sentence.adb b/example/sentence.adb
index c8493cb..288deeb 100644
--- a/example/sentence.adb
+++ b/example/sentence.adb
@@ -3,7 +3,7 @@
with
Ada.Text_IO,
- Packrat.Text.Standard,
+ Packrat.Text,
Packrat.Utilities;
use
@@ -19,7 +19,8 @@ procedure Sentence is
type Lexer_Labels is (Word, Whitespace);
type Parser_Labels is (S, NP, PP, VP, Det, Noun, Verb, Prep);
- package My_Rat is new Packrat.Text.Standard (Lexer_Labels, Parser_Labels);
+ package Text_Rat is new Packrat.Text (Lexer_Labels, Parser_Labels);
+ package My_Rat renames Text_Rat.Standard;
@@ -37,15 +38,15 @@ procedure Sentence is
- function Is_I is new My_Rat.Lexer_Traits.Tokens.Is_Value ("i");
- function Is_Saw is new My_Rat.Lexer_Traits.Tokens.Is_Value ("saw");
- function Is_A is new My_Rat.Lexer_Traits.Tokens.Is_Value ("a");
- function Is_Man is new My_Rat.Lexer_Traits.Tokens.Is_Value ("man");
- function Is_In is new My_Rat.Lexer_Traits.Tokens.Is_Value ("in");
- function Is_The is new My_Rat.Lexer_Traits.Tokens.Is_Value ("the");
- function Is_Park is new My_Rat.Lexer_Traits.Tokens.Is_Value ("park");
- function Is_With is new My_Rat.Lexer_Traits.Tokens.Is_Value ("with");
- function Is_Bat is new My_Rat.Lexer_Traits.Tokens.Is_Value ("bat");
+ function Is_I is new My_Rat.Lexer_Tokens.Is_Value ("i");
+ function Is_Saw is new My_Rat.Lexer_Tokens.Is_Value ("saw");
+ function Is_A is new My_Rat.Lexer_Tokens.Is_Value ("a");
+ function Is_Man is new My_Rat.Lexer_Tokens.Is_Value ("man");
+ function Is_In is new My_Rat.Lexer_Tokens.Is_Value ("in");
+ function Is_The is new My_Rat.Lexer_Tokens.Is_Value ("the");
+ function Is_Park is new My_Rat.Lexer_Tokens.Is_Value ("park");
+ function Is_With is new My_Rat.Lexer_Tokens.Is_Value ("with");
+ function Is_Bat is new My_Rat.Lexer_Tokens.Is_Value ("bat");
function Sat_In is new My_Rat.Parsers.Satisfy (Is_In);
function Sat_With is new My_Rat.Parsers.Satisfy (Is_With);