1 #ifndef TEUCHOS_PARSER_HPP
2 #define TEUCHOS_PARSER_HPP
8 #include <Teuchos_TableDecl.hpp>
9 #include <Teuchos_Grammar.hpp>
27 #ifdef HAVE_TEUCHOSCORE_CXX11
28 extern template struct Table<Action>;
34 Table<Action> terminal_table;
36 Table<int> nonterminal_table;
38 Parser(GrammarPtr g,
int nstates_reserve);
41 int add_state(Parser& p);
42 int get_nstates(Parser
const& p);
43 void add_terminal_action(Parser& p,
int state,
int terminal, Action action);
44 void add_nonterminal_action(Parser& p,
int state,
int nonterminal,
int next_state);
45 Action
const& get_action(Parser
const& p,
int state,
int terminal);
46 int execute_action(Parser
const& p, std::vector<int>& stack, Action
const& action);
47 GrammarPtr
const& get_grammar(Parser
const& p);
Parser make_lalr1_parser(GrammarPtr grammar, bool verbose)
Tries to create LALR(1) parser tables for a given grammar.
Tries to create LALR(1) parser tables for a given grammar.
Smart reference counting pointer class for automatic garbage collection.