+ 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
+ // yytname_[yyilooka_], etc.
+ // Until this gets fixed, this message appears in English only.
+ message = "syntax error, unexpected ";
+ message += yytnamerr_ (yytname_[yyilooka_]);
+ if (count < 5)
+ {
+ count = 0;
+ for (int x = yyxbegin; x < yyxend; ++x)
+ if (yycheck_[x + yyn_] == x && x != yyterror_)
+ {
+ message += (!count++) ? ", expecting " : " or ";
+ message += yytnamerr_ (yytname_[x]);
+ }
+ }
+ }
+ else