mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
* NEWS: Version 2.1.
* NEWS: Remove notice of yytname change, since it was never in an official release. * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing diagnostic. * src/output.c (prepare): Likewise. * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro. (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE is not defined. This is an awful hack, but it's enough for now. All callers changed. * tests/glr-regression-at (make_value): Args are const pointers now, to avoid GCC warning. (Duplicated user destructor for lookahead): New test. Currently skipped. It fails on my host but I'm not sure it'll always fail.
This commit is contained in:
@@ -920,12 +920,12 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys)
|
||||
if (yys->yysemantics.yyfirstVal)
|
||||
{
|
||||
yySemanticOption *yyoption = yys->yysemantics.yyfirstVal;
|
||||
yyGLRState *yyrhs;
|
||||
yyGLRState *yyrh;
|
||||
int yyn;
|
||||
for (yyrhs = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule);
|
||||
for (yyrh = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule);
|
||||
yyn > 0;
|
||||
yyrhs = yyrhs->yypred, yyn -= 1)
|
||||
yydestroyGLRState (yymsg, yyrhs);
|
||||
yyrh = yyrh->yypred, yyn -= 1)
|
||||
yydestroyGLRState (yymsg, yyrh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,12 @@ b4_syncline([@oline@], [@ofile@])[
|
||||
# define YYERROR_VERBOSE ]b4_error_verbose[
|
||||
#endif
|
||||
|
||||
#if YYERROR_VERBOSE
|
||||
# define YYERROR_VERBOSE_IF(x) x
|
||||
#else
|
||||
# define YYERROR_VERBOSE_IF(x) /* empty */
|
||||
#endif
|
||||
|
||||
/* Enabling the token table. */
|
||||
#ifndef YYTOKEN_TABLE
|
||||
# define YYTOKEN_TABLE ]b4_token_table[
|
||||
@@ -176,7 +182,7 @@ namespace yy
|
||||
|
||||
/// Generate an error message.
|
||||
/// \param tok the look-ahead token.
|
||||
virtual std::string yysyntax_error_ (int tok);
|
||||
virtual std::string yysyntax_error_ (YYERROR_VERBOSE_IF (int tok));
|
||||
|
||||
#if YYDEBUG
|
||||
/// \brief Report a symbol on the debug stream.
|
||||
@@ -695,7 +701,7 @@ yyerrlab:
|
||||
if (!yyerrstatus_)
|
||||
{
|
||||
++yynerrs_;
|
||||
error (yylloc, yysyntax_error_ (yyilooka));
|
||||
error (yylloc, yysyntax_error_ (YYERROR_VERBOSE_IF (yyilooka)));
|
||||
}
|
||||
|
||||
yyerror_range[0] = yylloc;
|
||||
@@ -816,7 +822,7 @@ yyreturn:
|
||||
|
||||
// Generate an error message.
|
||||
std::string
|
||||
yy::]b4_parser_class_name[::yysyntax_error_ (int tok)
|
||||
yy::]b4_parser_class_name[::yysyntax_error_ (YYERROR_VERBOSE_IF (int tok))
|
||||
{
|
||||
std::string res;
|
||||
#if YYERROR_VERBOSE
|
||||
|
||||
Reference in New Issue
Block a user