diff options
author | Jed Barber <jjbarber@y7mail.com> | 2020-12-04 15:28:52 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2020-12-04 15:28:52 +1100 |
commit | 0abd0d9444164cbb85df0e5a50451b5f98fef3db (patch) | |
tree | 1e5a075df2edc93e8c6919e5837149445fd2b3ba /example | |
parent | ad215be09de49dfb60245285d6ce20a0b58fdeac (diff) |
Instantiation package improvements
Diffstat (limited to 'example')
-rw-r--r-- | example/sentence.adb | 23 |
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); |