#include <parser.hh>

Classes | |
| union | semantic_type |
| Symbol semantic values. More... | |
| struct | token |
| Tokens. More... | |
Public Types | |
| typedef location | location_type |
| Symbol locations. | |
| typedef token::yytokentype | token_type |
| Token type. | |
| typedef int | debug_level_type |
| Type for debugging levels. | |
Public Member Functions | |
| parser (driver &theDriver_yyarg) | |
| Build a parser object. | |
| virtual int | parse () |
| Parse. | |
| std::ostream & | debug_stream () const |
| The current debugging stream. | |
| void | set_debug_stream (std::ostream &) |
| Set the current debugging stream. | |
| debug_level_type | debug_level () const |
| The current debugging level. | |
| void | set_debug_level (debug_level_type l) |
| Set the current debugging level. | |
Private Types | |
| typedef int | state_type |
| State numbers. | |
| typedef stack< state_type > | state_stack_type |
| State stack type. | |
| typedef stack< semantic_type > | semantic_stack_type |
| Semantic value stack type. | |
| typedef stack< location_type > | location_stack_type |
| location stack type. | |
| typedef unsigned char | token_number_type |
| Internal symbol numbers. | |
| typedef signed char | rhs_number_type |
| A type to store symbol numbers and -1. | |
Private Member Functions | |
| virtual void | error (const location_type &loc, const std::string &msg) |
| Report a syntax error. | |
| virtual std::string | yysyntax_error_ (int yystate, int tok) |
| Generate an error message. | |
| virtual void | yy_symbol_value_print_ (int yytype, const semantic_type *yyvaluep, const location_type *yylocationp) |
| Report a symbol value on the debug stream. | |
| virtual void | yy_symbol_print_ (int yytype, const semantic_type *yyvaluep, const location_type *yylocationp) |
| Report a symbol on the debug stream. | |
| virtual std::string | yytnamerr_ (const char *n) |
| Convert the symbol name n to a form suitable for a diagnostic. | |
| virtual void | yy_reduce_print_ (int r) |
| Report on the debug stream that the rule r is going to be reduced. | |
| virtual void | yystack_print_ () |
| Print the state stack on the debug stream. | |
| token_number_type | yytranslate_ (int t) |
| Convert a scanner token number t to a symbol number. | |
| void | yydestruct_ (const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp) |
| Reclaim the memory associated to a symbol. | |
| void | yypop_ (unsigned int n=1) |
| Pop n symbols the three stacks. | |
Private Attributes | |
| state_stack_type | yystate_stack_ |
| The state stack. | |
| semantic_stack_type | yysemantic_stack_ |
| The semantic value stack. | |
| location_stack_type | yylocation_stack_ |
| The location stack. | |
| int | yydebug_ |
| std::ostream * | yycdebug_ |
| driver & | theDriver |
Static Private Attributes | |
| static const signed char | yypact_ [] |
| For a state, the index in yytable_ of its portion. | |
| static const signed char | yypact_ninf_ = -48 |
| static const unsigned char | yydefact_ [] |
| For a state, default rule to reduce. Unlessyytable_ specifies something else to do. Zero means the default is an error. | |
| static const signed char | yypgoto_ [] |
| static const signed char | yydefgoto_ [] |
| static const unsigned char | yytable_ [] |
What to do in a state. yytable_[yypact_[s]]: what to do in state s.
| |
| static const signed char | yytable_ninf_ = -1 |
| static const signed char | yycheck_ [] |
| static const unsigned char | yystos_ [] |
| For a state, its accessing symbol. | |
| static const unsigned char | yyr1_ [] |
| For a rule, its LHS. | |
| static const unsigned char | yyr2_ [] |
| For a rule, its RHS length. | |
| static const char *const | yytname_ [] |
| For a symbol, its name in clear. | |
| static const rhs_number_type | yyrhs_ [] |
| A `-1'-separated list of the rules' RHS. | |
| static const unsigned char | yyprhs_ [] |
| For each rule, the index of the first RHS symbol in yyrhs_. | |
| static const unsigned short int | yyrline_ [] |
| For each rule, its source line number. | |
| static const unsigned short int | yytoken_number_ [] |
| For each scanner token number, its symbol number. | |
| static const int | yyeof_ = 0 |
| static const int | yylast_ = 49 |
| static const int | yynnts_ = 17 |
| static const int | yyempty_ = -2 |
| static const int | yyfinal_ = 7 |
| static const int | yyterror_ = 1 |
| static const int | yyerrcode_ = 256 |
| static const int | yyntokens_ = 14 |
| static const unsigned int | yyuser_token_number_max_ = 260 |
| static const token_number_type | yyundef_token_ = 2 |
A Bison parser.
The parser for the input file format.
This parser reads tokens from a yy::lexer one at a time, parses them according to the grammar specified in parser.yy and passes it on to an instance of class driver. The lexer object is not directly passed to the parser, but wrapped inside driver::scan.
Definition at line 142 of file parser.hh.
| void yy::parser::error | ( | const location_type & | loc, | |
| const std::string & | message | |||
| ) | [private, virtual] |
Report a syntax error.
Pass error messages on to the driver.
| loc | where the syntax error is found. | |
| msg | a description of the syntax error. | |
| location | the position in the input file where the error occurred. | |
| message | a textual description of the error. |
Definition at line 1314 of file parser.cc.
References driver::error().
Referenced by parse().
| int yy::parser::parse | ( | ) | [virtual] |
Parse.
Lookahead and lookahead in internal form.
Semantic value of the lookahead.
Location of the lookahead.
The locations where the error started and ended.
$$.
$.
Definition at line 477 of file parser.cc.
References append(), driver::checked_field(), error(), driver::file, yy::location::initialize(), driver::result(), driver::set_constraints(), driver::set_fields(), driver::set_names(), singleton(), yydefact_, yydestruct_(), yylocation_stack_, yypact_, yypop_(), yyr1_, yyr2_, yysemantic_stack_, yystate_stack_, yystos_, yysyntax_error_(), yytable_, and yytranslate_().
Referenced by driver::parse().
| void yy::parser::yy_symbol_print_ | ( | int | yytype, | |
| const semantic_type * | yyvaluep, | |||
| const location_type * | yylocationp | |||
| ) | [private, virtual] |
| void yy::parser::yy_symbol_value_print_ | ( | int | yytype, | |
| const semantic_type * | yyvaluep, | |||
| const location_type * | yylocationp | |||
| ) | [inline, private, virtual] |
Report a symbol value on the debug stream.
Definition at line 227 of file parser.cc.
References debug_stream().
Referenced by yy_symbol_print_().
| void yy::parser::yydestruct_ | ( | const char * | yymsg, | |
| int | yytype, | |||
| semantic_type * | yyvaluep, | |||
| location_type * | yylocationp | |||
| ) | [inline, private] |
| std::string yy::parser::yysyntax_error_ | ( | int | yystate, | |
| int | tok | |||
| ) | [private, virtual] |
const signed char yy::parser::yycheck_ [static, private] |
const unsigned char yy::parser::yydefact_ [static, private] |
{
4, 5, 6, 7, 0, 0, 0, 1, 0, 3,
0, 0, 11, 0, 10, 0, 0, 8, 0, 0,
9, 16, 0, 0, 14, 0, 0, 0, 12, 0,
0, 28, 13, 21, 0, 0, 19, 2, 25, 26,
27, 0, 0, 0, 0, 17, 0, 30, 28, 18,
0, 0, 24, 0, 23, 15, 29, 28, 20, 22
}
For a state, default rule to reduce. Unlessyytable_ specifies something else to do. Zero means the default is an error.
Definition at line 265 of file parser.hh.
Referenced by parse().
const signed char yy::parser::yydefgoto_ [static, private] |
const signed char yy::parser::yypact_ [static, private] |
{
-1, -48, -48, -48, 8, 17, 15, -48, 19, -48,
-1, 20, -48, -3, -48, 22, -1, -48, 5, 23,
-48, -48, -1, 9, -48, 25, 26, 5, -48, 6,
18, 3, -48, -48, -1, 11, -48, -48, -48, -48,
-48, 28, 24, 29, 6, -48, 27, 30, 3, -48,
31, 32, -48, 13, -48, -48, -48, 3, -48, -48
}
For a state, the index in yytable_ of its portion.
Definition at line 259 of file parser.hh.
Referenced by parse(), and yysyntax_error_().
const signed char yy::parser::yypgoto_ [static, private] |
const unsigned char yy::parser::yyprhs_ [static, private] |
{
0, 0, 3, 12, 15, 16, 18, 20, 22, 26,
30, 32, 34, 38, 42, 44, 52, 54, 58, 62,
64, 70, 72, 76, 78, 82, 84, 86, 88, 89,
92
}
For each rule, the index of the first RHS symbol in yyrhs_.
Definition at line 304 of file parser.hh.
Referenced by yy_reduce_print_().
const unsigned char yy::parser::yyr1_ [static, private] |
const unsigned char yy::parser::yyr2_ [static, private] |
{
0, 2, 8, 2, 0, 1, 1, 1, 3, 3,
1, 1, 3, 3, 1, 7, 1, 3, 3, 1,
5, 1, 3, 1, 3, 1, 1, 1, 0, 2,
0
}
For a rule, its RHS length.
Definition at line 286 of file parser.hh.
Referenced by parse(), and yy_reduce_print_().
const parser::rhs_number_type yy::parser::yyrhs_ [static, private] |
{
15, 0, -1, 16, 6, 18, 7, 21, 7, 24,
8, -1, 17, 9, -1, -1, 3, -1, 4, -1,
10, -1, 6, 19, 8, -1, 19, 7, 20, -1,
20, -1, 17, -1, 6, 22, 8, -1, 22, 7,
23, -1, 23, -1, 6, 17, 7, 28, 7, 5,
8, -1, 1, -1, 6, 25, 8, -1, 25, 7,
26, -1, 26, -1, 6, 17, 7, 27, 8, -1,
1, -1, 27, 7, 28, -1, 28, -1, 29, 5,
30, -1, 10, -1, 11, -1, 12, -1, -1, 13,
5, -1, -1
}
A `-1'-separated list of the rules' RHS.
Definition at line 302 of file parser.hh.
Referenced by yy_reduce_print_().
const unsigned short int yy::parser::yyrline_ [static, private] |
{
0, 192, 192, 195, 196, 199, 200, 201, 206, 209,
210, 213, 218, 221, 222, 225, 228, 233, 236, 237,
240, 241, 246, 247, 250, 251, 254, 255, 256, 259,
260
}
For each rule, its source line number.
Definition at line 306 of file parser.hh.
Referenced by yy_reduce_print_().
const unsigned char yy::parser::yystos_ [static, private] |
{
0, 3, 4, 10, 15, 16, 17, 0, 6, 9,
6, 18, 17, 19, 20, 7, 7, 8, 6, 21,
20, 1, 6, 22, 23, 7, 17, 7, 8, 6,
24, 7, 23, 1, 6, 25, 26, 8, 10, 11,
12, 28, 29, 17, 7, 8, 7, 5, 7, 26,
5, 13, 30, 27, 28, 8, 5, 7, 8, 28
}
For a state, its accessing symbol.
Definition at line 281 of file parser.hh.
Referenced by parse().
const unsigned char yy::parser::yytable_ [static, private] |
{
6, 54, 1, 2, 16, 17, 21, 33, 7, 3,
59, 22, 34, 38, 39, 40, 27, 28, 44, 45,
57, 58, 26, 8, 9, 10, 37, 15, 18, 47,
25, 29, 50, 31, 43, 46, 48, 56, 49, 55,
0, 32, 0, 51, 0, 0, 0, 0, 0, 20
}
What to do in a state. yytable_[yypact_[s]]: what to do in state s.
Definition at line 275 of file parser.hh.
Referenced by parse().
const char *const yy::parser::yytname_ [static, private] |
{
"\"end of file\"", "error", "$undefined", "\"word\"",
"\"quoted string\"", "\"integer\"", "'{'", "','", "'}'", "'='", "'*'",
"'+'", "'-'", "'/'", "$accept", "instance", "name", "string", "qns",
"qnl", "qn", "css", "csl", "cs", "vcs", "vcl", "vc", "rationals",
"rational", "sign", "denom", 0
}
For a symbol, its name in clear.
Definition at line 290 of file parser.hh.
Referenced by yy_symbol_print_(), and yysyntax_error_().
const unsigned short int yy::parser::yytoken_number_ [static, private] |
1.6.0