mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
glr.c, yacc.c: propagate yysymbol_type_t
Now that yacc.c and glr.c both know yysymbol_type_t, convert the common routines. * data/skeletons/c.m4 (yydestruct, yy_symbol_value_print) (yy_symbol_print): Use yysymbol_type_t instead of int. * data/skeletons/glr.c: Use yySymbol where appropriate. * data/skeletons/yacc.c (YY_ACCESSING_SYMBOL): New wrapper around yystos. Use it. * tests/local.at (yyreport_syntax_error): Use yysymbol_type_t where appropriate.
This commit is contained in:
@@ -633,13 +633,13 @@ yyreport_syntax_error (const yyparse_context_t *ctx]AT_PARAM_IF([, AT_PARSE_PARA
|
||||
fprintf (stderr, ": ");]])[
|
||||
fprintf (stderr, "syntax error");
|
||||
{
|
||||
int la = yyparse_context_token (ctx);
|
||||
yysymbol_type_t la = yyparse_context_token (ctx);
|
||||
if (la != YYEMPTY)
|
||||
fprintf (stderr, " on token [%s]", yysymbol_name (la));
|
||||
}
|
||||
{
|
||||
enum { TOKENMAX = 10 };
|
||||
int expected[TOKENMAX];
|
||||
yysymbol_type_t expected[TOKENMAX];
|
||||
int n = yyexpected_tokens (ctx, expected, TOKENMAX);
|
||||
/* Forward errors to yyparse. */
|
||||
if (n < 0)
|
||||
|
||||
Reference in New Issue
Block a user