-
-/*---------------------------------------------------.
-| 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];
- yypop_ (yylen_);
- 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 ();
- }
-
- if (yyn_ == yyfinal_)
- goto yyacceptlab;
-
- yyerror_range_[1] = yylloc;
- // Using YYLLOC is tempting, but would change the location of
- // the look-ahead. 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 (yylooka_ != yyeof_ && yylooka_ != yyempty_)
- yydestruct_ ("Error: discarding lookahead", yyilooka_, &yylval, &yylloc);
- return yyresult_;
-}
-
-void
-yy::]b4_parser_class_name[::yylex_ ()
-{
- YYCDEBUG << "Reading a token: ";
- yylooka_ = ]b4_c_function_call([yylex], [int],
-[[YYSTYPE*], [&yylval]][]dnl
-b4_location_if([, [[location*], [&yylloc]]])dnl
-m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
-}
-
-// Generate an error message, and invoke error.
-void
-yy::]b4_parser_class_name[::yyreport_syntax_error_ ()
-{
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus_)
- {
- ++yynerrs_;
- std::string message;
-#if YYERROR_VERBOSE
- 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_;
- 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
- // yyname_[yyilooka_], etc.
- // Until this gets fixed, this message appears in English only.
- message = "syntax error, unexpected ";
- message += yyname_[yyilooka_];
- if (count < 5)