PreviousUpNext

14.5.20  Lr_Table

The standard library Lr_Table api defines access to part of the mythryl-yacc parser-generator support infrastructure.

The Lr_Table api is implemented by the lr_table package.

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

The above information is manually maintained and may contain errors.

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;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext