From 0abd0d9444164cbb85df0e5a50451b5f98fef3db Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Fri, 4 Dec 2020 15:28:52 +1100 Subject: Instantiation package improvements --- example/sentence.adb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'example/sentence.adb') 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); -- cgit