/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton implementation for Bison LALR(1) parsers in C++ Copyright (C) 2002-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ // Take the name prefix into account. #define yylex examplelex /* First part of user declarations. */ /* Line 310 of lalr1.cc */ #line 10 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" #include #include "../lexer.h" /* Line 310 of lalr1.cc */ #line 39 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" #undef yylex #define yylex lexer.lex /* Line 310 of lalr1.cc */ #line 53 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\generated/parser.cpp" #include "parser.hpp" /* User implementation prologue. */ /* Line 316 of lalr1.cc */ #line 62 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\generated/parser.cpp" #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* FIXME: INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #define YYUSE(e) ((void) (e)) /* Enable debugging if requested. */ #if YYDEBUG /* A pseudo ostream that takes yydebug_ into account. */ # define YYCDEBUG if (yydebug_) (*yycdebug_) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug_) \ { \ *yycdebug_ << Title << ' '; \ yy_symbol_print_ ((Type), (Value), (Location)); \ *yycdebug_ << std::endl; \ } \ } while (false) # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug_) \ yy_reduce_print_ (Rule); \ } while (false) # define YY_STACK_PRINT() \ do { \ if (yydebug_) \ yystack_print_ (); \ } while (false) #else /* !YYDEBUG */ # define YYCDEBUG if (false) std::cerr # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_REDUCE_PRINT(Rule) # define YY_STACK_PRINT() #endif /* !YYDEBUG */ #define yyerrok (yyerrstatus_ = 0) #define yyclearin (yychar = yyempty_) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) namespace example { /* Line 379 of lalr1.cc */ #line 128 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\generated/parser.cpp" #if YYERROR_VERBOSE /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. */ std::string Parser::yytnamerr_ (const char *yystr) { if (*yystr == '"') { std::string yyr = ""; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: yyr += *yyp; break; case '"': return yyr; } do_not_strip_quotes: ; } return yystr; } #endif /// Build a parser object. Parser::Parser (class Lexer &lexer_yyarg, std::string streamname_yyarg, example::ParserSemanticAction &sa_yyarg) : #if YYDEBUG yydebug_ (false), yycdebug_ (&std::cerr), #endif lexer (lexer_yyarg), streamname (streamname_yyarg), sa (sa_yyarg) { } Parser::~Parser () { } #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ inline void Parser::yy_symbol_value_print_ (int yytype, const semantic_type* yyvaluep, const location_type* yylocationp) { YYUSE (yylocationp); YYUSE (yyvaluep); switch (yytype) { default: break; } } void Parser::yy_symbol_print_ (int yytype, const semantic_type* yyvaluep, const location_type* yylocationp) { *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") << ' ' << yytname_[yytype] << " (" << *yylocationp << ": "; yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); *yycdebug_ << ')'; } #endif void Parser::yydestruct_ (const char* yymsg, int yytype, semantic_type* yyvaluep, location_type* yylocationp) { YYUSE (yylocationp); YYUSE (yymsg); YYUSE (yyvaluep); YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } void Parser::yypop_ (unsigned int n) { yystate_stack_.pop (n); yysemantic_stack_.pop (n); yylocation_stack_.pop (n); } #if YYDEBUG std::ostream& Parser::debug_stream () const { return *yycdebug_; } void Parser::set_debug_stream (std::ostream& o) { yycdebug_ = &o; } Parser::debug_level_type Parser::debug_level () const { return yydebug_; } void Parser::set_debug_level (debug_level_type l) { yydebug_ = l; } #endif int Parser::parse () { /// Lookahead and lookahead in internal form. int yychar = yyempty_; int yytoken = 0; /* State. */ int yyn; int yylen = 0; int yystate = 0; /* Error handling. */ int yynerrs_ = 0; int yyerrstatus_ = 0; /// Semantic value of the lookahead. semantic_type yylval; /// Location of the lookahead. location_type yylloc; /// The locations where the error started and ended. location_type yyerror_range[2]; /// $$. semantic_type yyval; /// @$. location_type yyloc; int yyresult; YYCDEBUG << "Starting parse" << std::endl; /* User initialization code. */ /* Line 552 of lalr1.cc */ #line 28 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" { // initialize the initial location object yylloc.begin.filename = yylloc.end.filename = &streamname; } /* Line 552 of lalr1.cc */ #line 314 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\generated/parser.cpp" /* Initialize the stacks. The initial state will be pushed in yynewstate, since the latter expects the semantical and the location values to have been already stored, initialize these stacks with a primary value. */ yystate_stack_ = state_stack_type (0); yysemantic_stack_ = semantic_stack_type (0); yylocation_stack_ = location_stack_type (0); yysemantic_stack_.push (yylval); yylocation_stack_.push (yylloc); /* New state. */ yynewstate: yystate_stack_.push (yystate); YYCDEBUG << "Entering state " << yystate << std::endl; /* Accept? */ if (yystate == yyfinal_) goto yyacceptlab; goto yybackup; /* Backup. */ yybackup: /* Try to take a decision without lookahead. */ yyn = yypact_[yystate]; if (yyn == yypact_ninf_) goto yydefault; /* Read a lookahead token. */ if (yychar == yyempty_) { YYCDEBUG << "Reading a token: "; yychar = yylex (&yylval, &yylloc); } /* Convert token to internal form. */ if (yychar <= yyeof_) { yychar = yytoken = yyeof_; YYCDEBUG << "Now at end of input." << std::endl; } else { yytoken = yytranslate_ (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) goto yydefault; /* Reduce or error. */ yyn = yytable_[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == yytable_ninf_) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted. */ yychar = yyempty_; yysemantic_stack_.push (yylval); yylocation_stack_.push (yylloc); /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus_) --yyerrstatus_; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact_[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: yylen = yyr2_[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, use the top of the stack. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. */ if (yylen) yyval = yysemantic_stack_[yylen - 1]; else yyval = yysemantic_stack_[0]; { slice slice (yylocation_stack_, yylen); YYLLOC_DEFAULT (yyloc, slice, yylen); } YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* Line 677 of lalr1.cc */ #line 119 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {std::cout << "result=" << (yysemantic_stack_[(2) - (1)].as_expr()) << std::endl;} break; case 3: /* Line 677 of lalr1.cc */ #line 124 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 4: /* Line 677 of lalr1.cc */ #line 125 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_comma((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 6: /* Line 677 of lalr1.cc */ #line 132 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 7: /* Line 677 of lalr1.cc */ #line 133 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 8: /* Line 677 of lalr1.cc */ #line 134 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_mul((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 9: /* Line 677 of lalr1.cc */ #line 135 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_div((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 10: /* Line 677 of lalr1.cc */ #line 136 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_mod((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 11: /* Line 677 of lalr1.cc */ #line 137 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_add((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 12: /* Line 677 of lalr1.cc */ #line 138 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_sub((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 13: /* Line 677 of lalr1.cc */ #line 139 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_shr((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 14: /* Line 677 of lalr1.cc */ #line 140 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_shl((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 15: /* Line 677 of lalr1.cc */ #line 141 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_bitand((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 16: /* Line 677 of lalr1.cc */ #line 142 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_bitxor((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 17: /* Line 677 of lalr1.cc */ #line 143 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_assign_bitor((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 18: /* Line 677 of lalr1.cc */ #line 146 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 19: /* Line 677 of lalr1.cc */ #line 148 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_cond((yyval.as_expr()), (yysemantic_stack_[(5) - (1)].as_expr()), (yysemantic_stack_[(5) - (3)].as_expr()), (yysemantic_stack_[(5) - (5)].as_expr()));} break; case 20: /* Line 677 of lalr1.cc */ #line 151 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 21: /* Line 677 of lalr1.cc */ #line 152 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_logor((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 22: /* Line 677 of lalr1.cc */ #line 155 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 23: /* Line 677 of lalr1.cc */ #line 156 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_logand((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 24: /* Line 677 of lalr1.cc */ #line 159 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 25: /* Line 677 of lalr1.cc */ #line 160 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_bitor((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 26: /* Line 677 of lalr1.cc */ #line 163 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 27: /* Line 677 of lalr1.cc */ #line 164 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_bitxor((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 28: /* Line 677 of lalr1.cc */ #line 167 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 29: /* Line 677 of lalr1.cc */ #line 168 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_bitand((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 30: /* Line 677 of lalr1.cc */ #line 171 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 31: /* Line 677 of lalr1.cc */ #line 172 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_cmp_eq((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 32: /* Line 677 of lalr1.cc */ #line 173 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_cmp_ne((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 33: /* Line 677 of lalr1.cc */ #line 176 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 34: /* Line 677 of lalr1.cc */ #line 177 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_cmp_lt((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 35: /* Line 677 of lalr1.cc */ #line 178 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_cmp_gt((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 36: /* Line 677 of lalr1.cc */ #line 179 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_cmp_le((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 37: /* Line 677 of lalr1.cc */ #line 180 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_cmp_ge((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 38: /* Line 677 of lalr1.cc */ #line 183 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 39: /* Line 677 of lalr1.cc */ #line 184 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_shl((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 40: /* Line 677 of lalr1.cc */ #line 185 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_shr((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 41: /* Line 677 of lalr1.cc */ #line 188 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 42: /* Line 677 of lalr1.cc */ #line 189 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_add((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 43: /* Line 677 of lalr1.cc */ #line 190 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_sub((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 44: /* Line 677 of lalr1.cc */ #line 193 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 45: /* Line 677 of lalr1.cc */ #line 194 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_mul((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 46: /* Line 677 of lalr1.cc */ #line 195 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_div((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 47: /* Line 677 of lalr1.cc */ #line 196 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_mod((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_expr()));} break; case 48: /* Line 677 of lalr1.cc */ #line 199 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 49: /* Line 677 of lalr1.cc */ #line 200 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_preinc((yyval.as_expr()), (yysemantic_stack_[(2) - (2)].as_expr()));} break; case 50: /* Line 677 of lalr1.cc */ #line 201 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_predec((yyval.as_expr()), (yysemantic_stack_[(2) - (2)].as_expr()));} break; case 51: /* Line 677 of lalr1.cc */ #line 202 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_minus((yyval.as_expr()), (yysemantic_stack_[(2) - (2)].as_expr()));} break; case 52: /* Line 677 of lalr1.cc */ #line 203 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_plus((yyval.as_expr()), (yysemantic_stack_[(2) - (2)].as_expr()));} break; case 53: /* Line 677 of lalr1.cc */ #line 204 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_bitnot((yyval.as_expr()), (yysemantic_stack_[(2) - (2)].as_expr()));} break; case 54: /* Line 677 of lalr1.cc */ #line 205 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_lognot((yyval.as_expr()), (yysemantic_stack_[(2) - (2)].as_expr()));} break; case 55: /* Line 677 of lalr1.cc */ #line 208 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 56: /* Line 677 of lalr1.cc */ #line 209 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_subscript((yyval.as_expr()), (yysemantic_stack_[(4) - (1)].as_expr()), (yysemantic_stack_[(4) - (3)].as_expr()));} break; case 57: /* Line 677 of lalr1.cc */ #line 211 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_funcall((yyval.as_expr()), (yysemantic_stack_[(4) - (1)].as_expr()), (yysemantic_stack_[(4) - (3)].as_expr_list()));} break; case 58: /* Line 677 of lalr1.cc */ #line 212 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_member((yyval.as_expr()), (yysemantic_stack_[(3) - (1)].as_expr()), (yysemantic_stack_[(3) - (3)].as_string()));} break; case 59: /* Line 677 of lalr1.cc */ #line 213 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_postinc((yyval.as_expr()), (yysemantic_stack_[(2) - (1)].as_expr()));} break; case 60: /* Line 677 of lalr1.cc */ #line 214 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.op_postdec((yyval.as_expr()), (yysemantic_stack_[(2) - (1)].as_expr()));} break; case 61: /* Line 677 of lalr1.cc */ #line 217 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.create_expr_list((yyval.as_expr_list()));} break; case 62: /* Line 677 of lalr1.cc */ #line 218 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr_list((yyval.as_expr_list()), (yysemantic_stack_[(1) - (1)].as_expr_list()));} break; case 63: /* Line 677 of lalr1.cc */ #line 221 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.create_expr_list((yyval.as_expr_list())); sa.append_expr_list((yyval.as_expr_list()), (yysemantic_stack_[(1) - (1)].as_expr()));} break; case 64: /* Line 677 of lalr1.cc */ #line 223 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.append_expr_list((yysemantic_stack_[(3) - (1)].as_expr_list()), (yysemantic_stack_[(3) - (3)].as_expr())); sa.move_expr_list((yyval.as_expr_list()), (yysemantic_stack_[(3) - (1)].as_expr_list()));} break; case 65: /* Line 677 of lalr1.cc */ #line 227 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.ident((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_string()));} break; case 66: /* Line 677 of lalr1.cc */ #line 228 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.literal_i32((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_i32()));} break; case 67: /* Line 677 of lalr1.cc */ #line 229 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.literal_f64((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_f64()));} break; case 68: /* Line 677 of lalr1.cc */ #line 230 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.literal_str((yyval.as_expr()), (yysemantic_stack_[(1) - (1)].as_string()));} break; case 69: /* Line 677 of lalr1.cc */ #line 231 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" {sa.move_expr((yyval.as_expr()), (yysemantic_stack_[(3) - (2)].as_expr()));} break; /* Line 677 of lalr1.cc */ #line 904 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\generated/parser.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); yypop_ (yylen); yylen = 0; YY_STACK_PRINT (); yysemantic_stack_.push (yyval); yylocation_stack_.push (yyloc); /* Shift the result of the reduction. */ yyn = yyr1_[yyn]; yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; if (0 <= yystate && yystate <= yylast_ && yycheck_[yystate] == yystate_stack_[0]) yystate = yytable_[yystate]; else yystate = yydefgoto_[yyn - yyntokens_]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus_) { ++yynerrs_; error (yylloc, yysyntax_error_ (yystate, yytoken)); } yyerror_range[0] = yylloc; if (yyerrstatus_ == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= yyeof_) { /* Return failure if at end of input. */ if (yychar == yyeof_) YYABORT; } else { yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); yychar = yyempty_; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (false) goto yyerrorlab; yyerror_range[0] = yylocation_stack_[yylen - 1]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ yypop_ (yylen); yylen = 0; yystate = yystate_stack_[0]; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus_ = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact_[yystate]; if (yyn != yypact_ninf_) { yyn += yyterror_; if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) { yyn = yytable_[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yystate_stack_.height () == 1) YYABORT; yyerror_range[0] = yylocation_stack_[0]; yydestruct_ ("Error: popping", yystos_[yystate], &yysemantic_stack_[0], &yylocation_stack_[0]); yypop_ (); yystate = yystate_stack_[0]; YY_STACK_PRINT (); } yyerror_range[1] = yylloc; // Using YYLLOC is tempting, but would change the location of // the lookahead. YYLOC is available though. YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], &yysemantic_stack_[0], &yylocation_stack_[0]); yystate = yyn; goto yynewstate; /* Accept. */ yyacceptlab: yyresult = 0; goto yyreturn; /* Abort. */ yyabortlab: yyresult = 1; goto yyreturn; yyreturn: if (yychar != yyempty_) yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ yypop_ (yylen); while (yystate_stack_.height () != 1) { yydestruct_ ("Cleanup: popping", yystos_[yystate_stack_[0]], &yysemantic_stack_[0], &yylocation_stack_[0]); yypop_ (); } return yyresult; } // Generate an error message. std::string Parser::yysyntax_error_ (int yystate, int tok) { std::string res; YYUSE (yystate); #if YYERROR_VERBOSE int yyn = yypact_[yystate]; if (yypact_ninf_ < yyn && yyn <= yylast_) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = yylast_ - yyn + 1; int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; int count = 0; for (int x = yyxbegin; x < yyxend; ++x) if (yycheck_[x + yyn] == x && x != yyterror_) ++count; // FIXME: This method of building the message is not compatible // with internationalization. It should work like yacc.c does it. // That is, first build a string that looks like this: // "syntax error, unexpected %s or %s or %s" // Then, invoke YY_ on this string. // Finally, use the string as a format to output // yytname_[tok], etc. // Until this gets fixed, this message appears in English only. res = "syntax error, unexpected "; res += yytnamerr_ (yytname_[tok]); if (count < 5) { count = 0; for (int x = yyxbegin; x < yyxend; ++x) if (yycheck_[x + yyn] == x && x != yyterror_) { res += (!count++) ? ", expecting " : " or "; res += yytnamerr_ (yytname_[x]); } } } else #endif res = YY_("syntax error"); return res; } /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ const signed char Parser::yypact_ninf_ = -20; const signed char Parser::yypact_[] = { 105, -20, -20, -20, -20, 105, 105, 105, 105, 105, 105, 105, 17, 15, -20, -20, -20, 12, -16, 30, 31, 40, -7, 8, 39, 29, -17, 53, -4, -20, 1, -20, -20, -20, -20, -20, -20, -20, 105, -20, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 82, 105, 105, -20, -20, -20, -20, 13, -16, -20, 30, 31, 40, -7, 8, 8, 39, 39, 39, 39, 29, 29, -17, -17, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, 76, 83, -2, 105, -20, 105, -20, -20, -20 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ const unsigned char Parser::yydefact_[] = { 0, 66, 67, 68, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 6, 18, 20, 22, 24, 26, 28, 30, 33, 38, 41, 44, 48, 55, 0, 52, 49, 51, 50, 54, 53, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 59, 60, 69, 4, 0, 21, 44, 23, 25, 27, 29, 31, 32, 36, 34, 37, 35, 40, 39, 42, 43, 46, 45, 47, 7, 9, 11, 12, 8, 10, 13, 14, 15, 17, 16, 58, 63, 0, 62, 0, 0, 57, 0, 56, 19, 64 }; /* YYPGOTO[NTERM-NUM]. */ const signed char Parser::yypgoto_[] = { -20, -20, 14, -18, 2, -19, -20, 54, 56, 57, 52, 59, -13, 24, 5, 28, -6, -20, -20, -20, -20 }; /* YYDEFGOTO[NTERM-NUM]. */ const signed char Parser::yydefgoto_[] = { -1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 110, 111, 29 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. */ const signed char Parser::yytable_ninf_ = -1; const unsigned char Parser::yytable_[] = { 31, 32, 33, 34, 35, 36, 70, 38, 56, 71, 38, 72, 46, 47, 116, 75, 57, 37, 58, 30, 76, 113, 38, 40, 38, 73, 42, 39, 74, 48, 49, 50, 51, 84, 85, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 94, 95, 96, 109, 77, 41, 54, 90, 91, 55, 59, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 86, 87, 88, 89, 52, 43, 53, 60, 44, 61, 92, 93, 62, 45, 112, 63, 108, 64, 114, 65, 115, 66, 117, 78, 82, 118, 80, 67, 81, 68, 0, 69, 83, 0, 0, 79, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 7, 8, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 11 }; /* YYCHECK. */ const signed char Parser::yycheck_[] = { 6, 7, 8, 9, 10, 11, 10, 9, 25, 13, 9, 15, 19, 20, 16, 14, 33, 0, 35, 5, 38, 8, 9, 11, 9, 29, 42, 12, 32, 21, 22, 23, 24, 46, 47, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 71, 40, 43, 27, 52, 53, 30, 7, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 48, 49, 50, 51, 37, 47, 39, 26, 49, 28, 54, 55, 31, 45, 72, 34, 6, 36, 14, 38, 9, 40, 113, 41, 44, 115, 42, 46, 43, 48, -1, 50, 45, -1, -1, 113, 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 27, -1, 29, 30, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, 44 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ const unsigned char Parser::yystos_[] = { 0, 3, 4, 5, 6, 13, 27, 29, 30, 32, 41, 44, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 71, 53, 67, 67, 67, 67, 67, 67, 0, 9, 12, 11, 43, 42, 47, 49, 45, 19, 20, 21, 22, 23, 24, 37, 39, 27, 30, 25, 33, 35, 7, 26, 28, 31, 34, 36, 38, 40, 46, 48, 50, 10, 13, 15, 29, 32, 14, 54, 53, 58, 67, 59, 60, 61, 62, 63, 63, 64, 64, 64, 64, 65, 65, 66, 66, 67, 67, 67, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 6, 54, 69, 70, 53, 8, 14, 9, 16, 56, 54 }; #if YYDEBUG /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding to YYLEX-NUM. */ const unsigned short int Parser::yytoken_number_[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ const unsigned char Parser::yyr1_[] = { 0, 51, 52, 53, 53, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 69, 69, 70, 70, 71, 71, 71, 71, 71 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ const unsigned char Parser::yyr2_[] = { 0, 2, 2, 1, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 5, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, 1, 2, 2, 2, 2, 2, 2, 1, 4, 4, 3, 2, 2, 0, 1, 1, 3, 1, 1, 1, 1, 3 }; #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at \a yyntokens_, nonterminals. */ const char* const Parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "INTEGER_LITERAL", "FLOAT_LITERAL", "STRING_LITERAL", "IDENT", "EQUAL", "COLON", "COMMA", "DOT", "QUESTION", "SEMICOLON", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "EQEQ", "NE", "LE", "LT", "GE", "GT", "SLASH", "SLASHEQUAL", "PLUS", "PLUSEQUAL", "PLUSPLUS", "MINUS", "MINUSEQUAL", "MINUSMINUS", "STAR", "STAREQUAL", "MOD", "MODEQUAL", "SHR", "SHREQUAL", "SHL", "SHLEQUAL", "NOT", "LOGAND", "LOGOR", "TILDE", "AMP", "AMPEQUAL", "VBAR", "VBAREQUAL", "CARET", "CARETEQUAL", "$accept", "program", "expr", "expr_wo_comma", "assign_expr", "cond_expr", "logor_expr", "logand_expr", "bitor_expr", "bitxor_expr", "bitand_expr", "equality_expr", "relational_expr", "shift_expr", "add_expr", "mul_expr", "unary_expr", "postfix_expr", "expr_list_opt", "expr_list", "primary_expr", 0 }; #endif #if YYDEBUG /* YYRHS -- A `-1'-separated list of the rules' RHS. */ const Parser::rhs_number_type Parser::yyrhs_[] = { 52, 0, -1, 53, 12, -1, 54, -1, 53, 9, 54, -1, 55, -1, 56, -1, 67, 7, 55, -1, 67, 34, 55, -1, 67, 26, 55, -1, 67, 36, 55, -1, 67, 28, 55, -1, 67, 31, 55, -1, 67, 38, 55, -1, 67, 40, 55, -1, 67, 46, 55, -1, 67, 50, 55, -1, 67, 48, 55, -1, 57, -1, 57, 11, 53, 8, 56, -1, 58, -1, 57, 43, 58, -1, 59, -1, 58, 42, 59, -1, 60, -1, 59, 47, 60, -1, 61, -1, 60, 49, 61, -1, 62, -1, 61, 45, 62, -1, 63, -1, 62, 19, 63, -1, 62, 20, 63, -1, 64, -1, 63, 22, 64, -1, 63, 24, 64, -1, 63, 21, 64, -1, 63, 23, 64, -1, 65, -1, 64, 39, 65, -1, 64, 37, 65, -1, 66, -1, 65, 27, 66, -1, 65, 30, 66, -1, 67, -1, 66, 33, 67, -1, 66, 25, 67, -1, 66, 35, 67, -1, 68, -1, 29, 67, -1, 32, 67, -1, 30, 67, -1, 27, 67, -1, 44, 67, -1, 41, 67, -1, 71, -1, 68, 15, 53, 16, -1, 68, 13, 69, 14, -1, 68, 10, 6, -1, 68, 29, -1, 68, 32, -1, -1, 70, -1, 54, -1, 70, 9, 54, -1, 6, -1, 3, -1, 4, -1, 5, -1, 13, 53, 14, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ const unsigned char Parser::yyprhs_[] = { 0, 0, 3, 6, 8, 12, 14, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 62, 68, 70, 74, 76, 80, 82, 86, 88, 92, 94, 98, 100, 104, 108, 110, 114, 118, 122, 126, 128, 132, 136, 138, 142, 146, 148, 152, 156, 160, 162, 165, 168, 171, 174, 177, 180, 182, 187, 192, 196, 199, 202, 203, 205, 207, 211, 213, 215, 217, 219 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned char Parser::yyrline_[] = { 0, 119, 119, 124, 125, 129, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 146, 147, 151, 152, 155, 156, 159, 160, 163, 164, 167, 168, 171, 172, 173, 176, 177, 178, 179, 180, 183, 184, 185, 188, 189, 190, 193, 194, 195, 196, 199, 200, 201, 202, 203, 204, 205, 208, 209, 210, 212, 213, 214, 217, 218, 221, 223, 227, 228, 229, 230, 231 }; // Print the state stack on the debug stream. void Parser::yystack_print_ () { *yycdebug_ << "Stack now"; for (state_stack_type::const_iterator i = yystate_stack_.begin (); i != yystate_stack_.end (); ++i) *yycdebug_ << ' ' << *i; *yycdebug_ << std::endl; } // Report on the debug stream that the rule \a yyrule is going to be reduced. void Parser::yy_reduce_print_ (int yyrule) { unsigned int yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; /* Print the symbols being reduced, and their result. */ *yycdebug_ << "Reducing stack by rule " << yyrule - 1 << " (line " << yylno << "):" << std::endl; /* The symbols being reduced. */ for (int yyi = 0; yyi < yynrhs; yyi++) YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", yyrhs_[yyprhs_[yyrule] + yyi], &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), &(yylocation_stack_[(yynrhs) - (yyi + 1)])); } #endif // YYDEBUG /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ Parser::token_number_type Parser::yytranslate_ (int t) { static const token_number_type translate_table[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }; if ((unsigned int) t <= yyuser_token_number_max_) return translate_table[t]; else return yyundef_token_; } const int Parser::yyeof_ = 0; const int Parser::yylast_ = 149; const int Parser::yynnts_ = 21; const int Parser::yyempty_ = -2; const int Parser::yyfinal_ = 37; const int Parser::yyterror_ = 1; const int Parser::yyerrcode_ = 256; const int Parser::yyntokens_ = 51; const unsigned int Parser::yyuser_token_number_max_ = 305; const Parser::token_number_type Parser::yyundef_token_ = 2; } // example /* Line 1053 of lalr1.cc */ #line 1439 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\generated/parser.cpp" /* Line 1055 of lalr1.cc */ #line 235 "c:\\home\\k-aki\\work\\vs9\\test\\20110511_lex_yacc\\src\\parser.y" void example::Parser::error(const Parser::location_type& l, const std::string& m) { sa.error(l, m); }