|
g2o
|
A Bison parser. More...
#include <bison_parser.h>

Classes | |
| struct | basic_symbol |
| struct | by_kind |
| Type access provider for token (enum) based symbols. More... | |
| struct | by_state |
| Type access provider for state based symbols. More... | |
| class | context |
| class | stack |
| A stack with random access from its top. More... | |
| struct | stack_symbol_type |
| "Internal" symbol: element of the stack. More... | |
| struct | symbol_kind |
| Symbol kinds. More... | |
| struct | symbol_type |
| "External" symbols: returned by the scanner. More... | |
| struct | syntax_error |
| Syntax errors thrown from user actions. More... | |
| struct | token |
| Token kinds. More... | |
| union | value_type |
| Symbol semantic values. More... | |
Public Types | |
| typedef value_type | semantic_type |
| Backward compatibility (Bison 3.8). | |
| typedef location | location_type |
| Symbol locations. | |
| typedef token::token_kind_type | token_kind_type |
| Token kind, as returned by yylex. | |
| typedef token_kind_type | token_type |
| Backward compatibility alias (Bison 3.6). | |
| typedef symbol_kind::symbol_kind_type | symbol_kind_type |
| (Internal) symbol kind. | |
| typedef by_kind | by_type |
| Backward compatibility for a private implementation detail (Bison 3.6). | |
Public Member Functions | |
| Parser (class Driver &driver_yyarg) | |
| Build a parser object. | |
| virtual | ~Parser () |
| int | operator() () |
| virtual int | parse () |
| virtual void | error (const location_type &loc, const std::string &msg) |
| void | error (const syntax_error &err) |
| Report a syntax error. | |
Static Public Member Functions | |
| static std::string | symbol_name (symbol_kind_type yysymbol) |
Static Public Attributes | |
| static const symbol_kind_type | YYNTOKENS = symbol_kind::YYNTOKENS |
| The number of tokens. | |
Private Types | |
| enum | { yylast_ = 68 , yynnts_ = 10 , yyfinal_ = 2 } |
| Constants. More... | |
| typedef signed char | state_type |
| Stored state numbers (used for stacks). | |
| typedef stack< stack_symbol_type > | stack_type |
| Stack type. | |
Private Member Functions | |
| Parser (const Parser &) | |
| Non copyable. | |
| Parser & | operator= (const Parser &) |
| Non copyable. | |
| int | yy_syntax_error_arguments_ (const context &yyctx, symbol_kind_type yyarg[], int yyargn) const |
| The arguments of the error message. | |
| virtual std::string | yysyntax_error_ (const context &yyctx) const |
| template<typename Base > | |
| void | yy_destroy_ (const char *yymsg, basic_symbol< Base > &yysym) const |
| Reclaim the memory associated to a symbol. | |
| void | yypush_ (const char *m, YY_MOVE_REF(stack_symbol_type) sym) |
| void | yypush_ (const char *m, state_type s, YY_MOVE_REF(symbol_type) sym) |
| void | yypop_ (int n=1) YY_NOEXCEPT |
| Pop n symbols from the stack. | |
Static Private Member Functions | |
| static state_type | yy_lr_goto_state_ (state_type yystate, int yysym) |
| static bool | yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT |
| static bool | yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT |
| static symbol_kind_type | yytranslate_ (int t) YY_NOEXCEPT |
| static std::string | yytnamerr_ (const char *yystr) |
| Convert the symbol name n to a form suitable for a diagnostic. | |
Private Attributes | |
| stack_type | yystack_ |
| The stack. | |
| class Driver & | driver |
Static Private Attributes | |
| static const signed char | yypact_ninf_ = -24 |
| static const signed char | yytable_ninf_ = -1 |
| static const char *const | yytname_ [] |
| For a symbol, its name in clear. | |
| static const signed char | yypact_ [] |
| static const signed char | yydefact_ [] |
| static const signed char | yypgoto_ [] |
| static const signed char | yydefgoto_ [] = {0, 20, 29, 8, 9, 10, 11, 12, 13, 1} |
| static const signed char | yytable_ [] |
| static const signed char | yycheck_ [] |
| static const signed char | yystos_ [] |
| static const signed char | yyr1_ [] |
| static const signed char | yyr2_ [] |
A Bison parser.
Definition at line 187 of file bison_parser.h.
| typedef by_kind SlamParser::Parser::by_type |
Backward compatibility for a private implementation detail (Bison 3.6).
Definition at line 400 of file bison_parser.h.
Symbol locations.
Definition at line 213 of file bison_parser.h.
Backward compatibility (Bison 3.8).
Definition at line 210 of file bison_parser.h.
|
private |
Stack type.
Definition at line 709 of file bison_parser.h.
|
private |
Stored state numbers (used for stacks).
Definition at line 476 of file bison_parser.h.
(Internal) symbol kind.
Definition at line 293 of file bison_parser.h.
Token kind, as returned by yylex.
Definition at line 253 of file bison_parser.h.
Backward compatibility alias (Bison 3.6).
Definition at line 256 of file bison_parser.h.
|
private |
Constants.
| Enumerator | |
|---|---|
| yylast_ | Last index in yytable_. |
| yynnts_ | Number of nonterminal symbols. |
| yyfinal_ | Termination state number. |
Definition at line 733 of file bison_parser.h.
| SlamParser::Parser::Parser | ( | class Driver & | driver_yyarg | ) |
Build a parser object.
Definition at line 156 of file bison_parser.cpp.
|
virtual |
Definition at line 166 of file bison_parser.cpp.
|
private |
Non copyable.
|
virtual |
Report a syntax error.
| loc | where the syntax error is found. |
| msg | a description of the syntax error. |
Definition at line 1258 of file bison_parser.cpp.
| void SlamParser::Parser::error | ( | const syntax_error & | err | ) |
Report a syntax error.
Definition at line 969 of file bison_parser.cpp.
References error(), and SlamParser::Parser::syntax_error::location.
| int SlamParser::Parser::operator() | ( | ) |
Parse. An alias for parse ().
Definition at line 426 of file bison_parser.cpp.
References parse().
|
virtual |
Parse.
Length of the RHS of the rule being reduced.
The lookahead symbol.
The locations where the error started and ended.
The return value of parse ().
Definition at line 428 of file bison_parser.cpp.
References SlamParser::location::begin, SlamParser::Parser::basic_symbol< Base >::clear(), SlamParser::Parser::stack< T, S >::clear(), SlamParser::Parser::value_type::commandNode, SlamParser::Parser::value_type::doubleVal, driver, SlamParser::Parser::basic_symbol< Base >::empty(), SlamParser::location::end, error(), SlamParser::position::filename, SlamParser::Parser::value_type::intList, SlamParser::Parser::by_kind::kind(), SlamParser::Parser::by_kind::kind_, SlamParser::Parser::basic_symbol< Base >::location, SlamParser::SlamContext::process(), SlamParser::Parser::symbol_kind::S_YYEOF, SlamParser::Parser::symbol_kind::S_YYerror, SlamParser::Parser::symbol_kind::S_YYUNDEF, SlamParser::Parser::stack< T, S >::size(), SlamParser::Driver::slamContext, SlamParser::Parser::by_state::state, SlamParser::Driver::streamname, SlamParser::Parser::basic_symbol< Base >::value, yy_destroy_(), yy_lr_goto_state_(), YY_MOVE, YY_NULLPTR, yy_pact_value_is_default_(), YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, yy_table_value_is_error_(), YYABORT, YYACCEPT, YYCDEBUG, yycheck_, yydefact_, YYERROR, yyfinal_, yylast_, yylex, YYLLOC_DEFAULT, yypact_, yypop_(), yypush_(), yyr1_, yyr2_, yystack_, yysyntax_error_(), yytable_, and yytranslate_().
Referenced by operator()(), and SlamParser::Driver::parse_stream().
|
static |
The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking.
Definition at line 1008 of file bison_parser.cpp.
References yytname_, and yytnamerr_().
Referenced by yysyntax_error_().
|
private |
Reclaim the memory associated to a symbol.
| yymsg | Why this token is reclaimed. If null, print nothing. |
| yysym | The symbol. |
Definition at line 299 of file bison_parser.cpp.
References SlamParser::Parser::value_type::commandNode, SlamParser::Parser::symbol_kind::S_add_se2, SlamParser::Parser::symbol_kind::S_add_se3, SlamParser::Parser::symbol_kind::S_STRING, SlamParser::Parser::value_type::stringVal, SlamParser::Parser::basic_symbol< Base >::value, and YY_SYMBOL_PRINT.
Referenced by parse().
|
staticprivate |
Compute post-reduction state.
| yystate | the current state |
| yysym | the nonterminal to push on the stack |
Definition at line 410 of file bison_parser.cpp.
References yycheck_, yydefgoto_, yylast_, YYNTOKENS, yypgoto_, and yytable_.
Referenced by parse().
|
staticprivate |
Whether the given yypact_ value indicates a defaulted state.
| yyvalue | the value to check |
Definition at line 418 of file bison_parser.cpp.
References yypact_ninf_.
Referenced by SlamParser::Parser::context::expected_tokens(), and parse().
|
private |
The arguments of the error message.
Definition at line 1046 of file bison_parser.cpp.
References SlamParser::Parser::basic_symbol< Base >::empty(), SlamParser::Parser::context::expected_tokens(), SlamParser::Parser::context::lookahead(), and SlamParser::Parser::context::token().
Referenced by yysyntax_error_().
|
staticprivate |
Whether the given yytable_ value indicates a syntax error.
| yyvalue | the value to check |
Definition at line 422 of file bison_parser.cpp.
References yytable_ninf_.
Referenced by SlamParser::Parser::context::expected_tokens(), and parse().
|
private |
Pop n symbols from the stack.
Definition at line 398 of file bison_parser.cpp.
References SlamParser::Parser::stack< T, S >::pop(), and yystack_.
Referenced by parse().
|
private |
Push a new look ahead token on the state on the stack.
| m | a debug message to display if null, no trace is output. |
| s | the state |
| sym | the symbol (for its value and location). |
Definition at line 388 of file bison_parser.cpp.
References yypush_().
|
private |
Push a new state on the stack.
| m | a debug message to display if null, no trace is output. |
| sym | the symbol |
Definition at line 383 of file bison_parser.cpp.
References SlamParser::Parser::stack< T, S >::push(), YY_MOVE, YY_SYMBOL_PRINT, and yystack_.
|
privatevirtual |
Generate an error message.
| yyctx | the context in which the error occurred. |
Definition at line 1083 of file bison_parser.cpp.
References symbol_name(), YY_, YY_NULLPTR, yy_syntax_error_arguments_(), and YYCASE_.
Referenced by parse().
|
staticprivate |
Convert the symbol name n to a form suitable for a diagnostic.
Definition at line 978 of file bison_parser.cpp.
Referenced by symbol_name().
|
staticprivate |
Convert a scanner token kind t to a symbol kind. In theory t should be a token_kind_type, but character literals are valid, yet not members of the token_kind_type enum.
Definition at line 1225 of file bison_parser.cpp.
References SlamParser::Parser::symbol_kind::S_YYEOF, and SlamParser::Parser::symbol_kind::S_YYUNDEF.
Referenced by parse().
|
private |
Definition at line 740 of file bison_parser.h.
Referenced by parse().
|
staticprivate |
Definition at line 533 of file bison_parser.h.
Referenced by SlamParser::Parser::context::expected_tokens(), parse(), and yy_lr_goto_state_().
|
staticprivate |
Definition at line 520 of file bison_parser.h.
Referenced by parse().
|
staticprivate |
Definition at line 526 of file bison_parser.h.
Referenced by yy_lr_goto_state_().
|
static |
The number of tokens.
Definition at line 296 of file bison_parser.h.
Referenced by SlamParser::Parser::context::expected_tokens(), and yy_lr_goto_state_().
|
staticprivate |
Definition at line 515 of file bison_parser.h.
Referenced by SlamParser::Parser::context::expected_tokens(), and parse().
|
staticprivate |
Definition at line 498 of file bison_parser.h.
Referenced by yy_pact_value_is_default_().
|
staticprivate |
Definition at line 523 of file bison_parser.h.
Referenced by yy_lr_goto_state_().
|
staticprivate |
Definition at line 540 of file bison_parser.h.
Referenced by parse().
|
staticprivate |
Definition at line 544 of file bison_parser.h.
Referenced by parse().
|
private |
The stack.
Definition at line 712 of file bison_parser.h.
|
staticprivate |
Definition at line 537 of file bison_parser.h.
Referenced by SlamParser::Parser::by_state::kind().
|
staticprivate |
Definition at line 531 of file bison_parser.h.
Referenced by SlamParser::Parser::context::expected_tokens(), parse(), and yy_lr_goto_state_().
|
staticprivate |
Definition at line 499 of file bison_parser.h.
Referenced by yy_table_value_is_error_().
|
staticprivate |
For a symbol, its name in clear.
Definition at line 510 of file bison_parser.h.
Referenced by symbol_name().