summaryrefslogtreecommitdiff
path: root/test/packrat-lexer-debug.ads
blob: bd6c2de2bf7a51255dd4afc61efc9777b0fac3bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89


with

    Ada.Containers.Vectors;


generic
package Packrat.Lexer.Debug is


    Empty_Fail : constant Combinator_Result;


    function Create_Result
           (Finish : in Natural;
            Status : in Result_Status)
        return Combinator_Result;

    function Join
           (Left, Right : in Combinator_Result)
        return Combinator_Result;

    function Status
           (This : in Combinator_Result)
        return Result_Status;

    function Debug_String
           (This : in Combinator_Result)
        return String;




    type Token_Vector is tagged private;

    function So_Far
           (This : in Lexer_Context)
        return Token_Vector;

    function Position
           (This : in Lexer_Context)
        return Positive;

    function Status
           (This : in Lexer_Context)
        return Result_Status;

    function Has_Pass
           (This : in Lexer_Context)
        return Boolean;

    function Pass
           (This : in Lexer_Context)
        return Traits.Element_Array;

    function Length
           (Vec : in Token_Vector)
        return Natural;

    function Element
           (Vec : in Token_Vector;
            Dex : in Positive)
        return Traits.Tokens.Token;




    function Is_Failure
           (Result : in Component_Result)
        return Boolean;

    function Is_Success
           (Result : in Component_Result)
        return Boolean;


private


    Empty_Fail : constant Combinator_Result := Packrat.Lexer.Empty_Fail;


    type Token_Vector is new Token_Vectors.Vector with null record;


end Packrat.Lexer.Debug;