PreviousUpNext

14.5.45  Token

The standard library Token api defines the token type used by the mythryl-yacc parser generator.

The Token api source code is in src/app/yacc/lib/base.api.

The above information is manually maintained and may contain errors.

api {   package lr_table
          : api {
                Pairlist (X, Y) = EMPTY | PAIR (X , Y , Pairlist((X, Y)));
                State  = STATE Int;
                Terminal  = TERM Int;
                Nonterminal  = NONTERM Int;
                Action  = ACCEPT | ERROR | REDUCE Int | SHIFT State;
                Table;
                state_count : Table -> Int;
                rule_count : Table -> Int;
                describe_goto : Table -> State -> Pairlist((Nonterminal, State));
                action : Table -> (State , Terminal) -> Action;
                goto : Table -> (State , Nonterminal) -> State;
                initial_state : Table -> State;
                describe_actions : Table -> State -> (Pairlist((Terminal, Action)) , Action);
                exception GOTO (State , Nonterminal);
                    make_lr_table :
                            {actions:Rw_Vector(((Pairlist((Terminal, Action)) , Action)) ),
                            gotos:Rw_Vector(Pairlist((Nonterminal, State)) ), initial_state:State, rule_count:Int,
                            state_count:Int}
                        ->
                        Table;};;
    Token (X, Y) = TOKEN (lr_table::Terminal , ((X , Y , Y)));
    same_token : (Token((X, Y)) , Token((X, Y))) -> Bool;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext