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:
Akim Demaille
2020-03-29 11:51:31 +02:00
parent 39792f57fb
commit 086506bf23
4 changed files with 16 additions and 13 deletions

View File

@@ -620,7 +620,7 @@ m4_define_default([b4_yydestruct_define],
static void
yydestruct (const char *yymsg,
int yytype, YYSTYPE *yyvaluep]b4_locations_if(dnl
yysymbol_type_t yytype, YYSTYPE *yyvaluep]b4_locations_if(dnl
[[, YYLTYPE *yylocationp]])[]b4_user_formals[)
{
]b4_parse_param_use([yyvaluep], [yylocationp])dnl
@@ -646,7 +646,7 @@ m4_define_default([b4_yy_symbol_print_define],
static void
yy_symbol_value_print (FILE *yyo,
int yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl
yysymbol_type_t yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl
[[, YYLTYPE const * const yylocationp]])[]b4_user_formals[)
{
FILE *yyoutput = yyo;
@@ -674,7 +674,7 @@ b4_percent_code_get([[post-printer]])dnl
static void
yy_symbol_print (FILE *yyo,
int yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl
yysymbol_type_t yytype, YYSTYPE const * const yyvaluep]b4_locations_if(dnl
[[, YYLTYPE const * const yylocationp]])[]b4_user_formals[)
{
YYFPRINTF (yyo, "%s %s (",