diff --git a/data/skeletons/c.m4 b/data/skeletons/c.m4 index 0987ef77..c98bed1a 100644 --- a/data/skeletons/c.m4 +++ b/data/skeletons/c.m4 @@ -662,7 +662,7 @@ b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl m4_ifset([b4_parse_param], [, b4_parse_param]))[ { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yytype < YYNTOKENS ? "token" : "nterm", yysymbol_name (yytype)); ]b4_locations_if([ YY_LOCATION_PRINT (yyo, *yylocationp); YYFPRINTF (yyo, ": "); diff --git a/data/skeletons/glr.c b/data/skeletons/glr.c index cf6b1d8a..98b3f1e2 100644 --- a/data/skeletons/glr.c +++ b/data/skeletons/glr.c @@ -693,7 +693,7 @@ yyMemoryExhausted (yyGLRStack* yystackp) #if ]b4_error_verbose_if([[1]], [b4_api_PREFIX[DEBUG]])[ /** A printable representation of TOKEN. */ static inline const char* -yytokenName (yySymbol yytoken) +yysymbol_name (yySymbol yytoken) { return yytoken == YYEMPTY ? "" : yytname[yytoken]; } @@ -1738,11 +1738,11 @@ yyreportTree (yySemanticOption* yyx, int yyindent) if (yyx->yystate->yyposn < yys->yyposn + 1) YY_FPRINTF ((stderr, "%*s%s -> \n", - yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), + yyindent, "", yysymbol_name (yylhsNonterm (yyx->yyrule)), yyx->yyrule - 1)); else YY_FPRINTF ((stderr, "%*s%s -> \n", - yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)), + yyindent, "", yysymbol_name (yylhsNonterm (yyx->yyrule)), yyx->yyrule - 1, YY_CAST (long, yys->yyposn + 1), YY_CAST (long, yyx->yystate->yyposn))); for (yyi = 1; yyi <= yynrhs; yyi += 1) @@ -1751,10 +1751,10 @@ yyreportTree (yySemanticOption* yyx, int yyindent) { if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn) YY_FPRINTF ((stderr, "%*s%s \n", yyindent+2, "", - yytokenName (yystos[yystates[yyi]->yylrState]))); + yysymbol_name (yystos[yystates[yyi]->yylrState]))); else YY_FPRINTF ((stderr, "%*s%s \n", yyindent+2, "", - yytokenName (yystos[yystates[yyi]->yylrState]), + yysymbol_name (yystos[yystates[yyi]->yylrState]), YY_CAST (long, yystates[yyi-1]->yyposn + 1), YY_CAST (long, yystates[yyi]->yyposn))); } @@ -2111,7 +2111,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) if (yytoken != YYEMPTY) { int yyn = yypact[yystackp->yytops.yystates[0]->yylrState]; - yyarg[yycount++] = yytokenName (yytoken); + yyarg[yycount++] = yysymbol_name (yytoken); if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in @@ -2131,7 +2131,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) yycount = 1; break; } - yyarg[yycount++] = yytokenName (yyx); + yyarg[yycount++] = yysymbol_name (yyx); } } } diff --git a/src/parse-gram.c b/src/parse-gram.c index ab4eeea7..00b4b545 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -1121,7 +1121,7 @@ static void yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yytype < YYNTOKENS ? "token" : "nterm", yysymbol_name (yytype)); YY_LOCATION_PRINT (yyo, *yylocationp); YYFPRINTF (yyo, ": ");