PreviousUpNext

14.5.28  Parser_Data

The standard library Parser_Data api defines the Parser_Data type used by the Mythryl-Yacc parser generator.

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

The above information is manually maintained and may contain errors.

api {
    Source_Position;
    Semantic_Value;
    Arg;
    Result;
        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;};;
        package token
          : 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;};;
        package actions
          : api {   actions :
                        (   Int , Source_Position ,
                            List(((lr_table::State , ((Semantic_Value , Source_Position , Source_Position)))) ) , Arg
                        )
                        ->
                        (   lr_table::Nonterminal , ((Semantic_Value , Source_Position , Source_Position)) ,
                            List(((lr_table::State , ((Semantic_Value , Source_Position , Source_Position)))) )
                        );
                void : Semantic_Value;
                extract : Semantic_Value -> Result;};;
        package error_recovery
          : api {
                is_keyword : lr_table::Terminal -> Bool;
                no_shift : lr_table::Terminal -> Bool;
                errtermvalue : lr_table::Terminal -> Semantic_Value;
                show_terminal : lr_table::Terminal -> String;
                terms : List(lr_table::Terminal );
                preferred_change : List(((List(lr_table::Terminal ) , List(lr_table::Terminal ))) );};;
    table : lr_table::Table;
sharing lr_table = token::lr_table};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext