From 67edc77677d366d4dc0ff42154c79a1d87c2dd29 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 10 Jan 2019 15:27:56 +1100 Subject: Packrat.Lexer.Combinators specification --- src/packrat-lexer-combinators.ads | 187 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 src/packrat-lexer-combinators.ads (limited to 'src/packrat-lexer-combinators.ads') diff --git a/src/packrat-lexer-combinators.ads b/src/packrat-lexer-combinators.ads new file mode 100644 index 0000000..764887c --- /dev/null +++ b/src/packrat-lexer-combinators.ads @@ -0,0 +1,187 @@ + + +generic +package Packrat.Lexer.Combinators is + + + generic + Params : in Combinator_Array; + function Sequence + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + with function Param + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + Number : in Positive; + function Count + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + with function Param + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + Minimum : in Natural := 0; + function Many + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + with function Param + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + with function Test + (Item : in Element) + return Boolean; + Minimum : in Natural := 0; + function Many_Until + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + + + + generic + with function Test + (Item : in Element) + return Boolean; + function Satisfy + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + with function Test + (Item : in Element) + return Boolean; + with function Change + (From : in Element) + return Element; + function Satisfy_With + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + Item : in Element; + function Match + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + Item : in Element; + with function Change + (From : in Element) + return Element; + function Match_With + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + Items : in Element_Array; + function Multimatch + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + Number : in Positive := 1; + function Take + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + with function Test + (Item : in Element) + return Boolean; + function Take_While + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + generic + with function Test + (Item : in Element) + return Boolean; + function Take_Until + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + + + + function Start_Of_Line + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + function End_Of_Line + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + function Start_Of_Input + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + function End_Of_Input + (Input : in Element_Array; + Start : in Positive; + Length : out Natural; + Value : out Element_Array) + return Result; + + +end Packrat.Lexer.Combinators; + + -- cgit