[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/21] regen
From: |
Akim Demaille |
Subject: |
[PATCH 18/21] regen |
Date: |
Wed, 1 Apr 2020 08:37:44 +0200 |
---
src/parse-gram.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/parse-gram.c b/src/parse-gram.c
index f77fb6d6..069e667e 100644
--- a/src/parse-gram.c
+++ b/src/parse-gram.c
@@ -630,6 +630,9 @@ static const yytype_int16 yyrline[] =
};
#endif
+/** Accessing symbol of state STATE. */
+#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_type_t, yystos[State])
+
#if 1
/* The user-facing name of the symbol whose (internal) number is
YYSYMBOL. No bounds checking. */
@@ -1032,7 +1035,7 @@ do {
\
static void
yy_symbol_value_print (FILE *yyo,
- int yytype, YYSTYPE const * const yyvaluep, YYLTYPE
const * const yylocationp)
+ yysymbol_type_t yytype, YYSTYPE const * const yyvaluep,
YYLTYPE const * const yylocationp)
{
FILE *yyoutput = yyo;
YYUSE (yyoutput);
@@ -1243,7 +1246,7 @@ troff (yyo);
static void
yy_symbol_print (FILE *yyo,
- int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const *
const yylocationp)
+ yysymbol_type_t yytype, YYSTYPE const * const yyvaluep,
YYLTYPE const * const yylocationp)
{
YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yysymbol_name (yytype));
@@ -1296,7 +1299,7 @@ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
YYLTYPE *yylsp,
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- yystos[+yyssp[yyi + 1 - yynrhs]],
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
&yyvsp[(yyi + 1) - (yynrhs)]
, &(yylsp[(yyi + 1) - (yynrhs)])
);
YYFPRINTF (stderr, "\n");
@@ -1660,7 +1663,7 @@ yyreport_syntax_error (const yyparse_context_t *yyctx);
static void
yydestruct (const char *yymsg,
- int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
+ yysymbol_type_t yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
{
YYUSE (yyvaluep);
YYUSE (yylocationp);
@@ -2592,7 +2595,7 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_type_t, yyr1[yyn]), &yyval,
&yyloc);
YYPOPSTACK (yylen);
yylen = 0;
@@ -2706,7 +2709,7 @@ yyerrlab1:
yyerror_range[1] = *yylsp;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp, yylsp);
+ YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -2727,7 +2730,7 @@ yyerrlab1:
*++yylsp = yyloc;
/* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
@@ -2779,7 +2782,7 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[+*yyssp], yyvsp, yylsp);
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
--
2.26.0
- [PATCH 08/21] regen, (continued)
- [PATCH 08/21] regen, Akim Demaille, 2020/04/01
- [PATCH 07/21] yacc.c: prefer YYSYMBOL_YYERROR to YYSYMBOL_error, Akim Demaille, 2020/04/01
- [PATCH 09/21] bistromathic: use symbol numbers instead of YYTRANSLATE, Akim Demaille, 2020/04/01
- [PATCH 11/21] regen, Akim Demaille, 2020/04/01
- [PATCH 10/21] yysymbol_type_t: always assign an enumerator, Akim Demaille, 2020/04/01
- [PATCH 12/21] yacc.c: revert to not using yysymbol_type_t in the yytranslate table, Akim Demaille, 2020/04/01
- [PATCH 13/21] regen, Akim Demaille, 2020/04/01
- [PATCH 14/21] yacc.c: fix more errors from make maintainer-check-g++, Akim Demaille, 2020/04/01
- [PATCH 15/21] regen, Akim Demaille, 2020/04/01
- [PATCH 16/21] glr.c: use yysymbol_type_t, YYSYMBOL_YYEOF etc., Akim Demaille, 2020/04/01
- [PATCH 18/21] regen,
Akim Demaille <=
- [PATCH 17/21] glr.c, yacc.c: propagate yysymbol_type_t, Akim Demaille, 2020/04/01
- [PATCH 19/21] glr.c: remove the yySymbol alias, Akim Demaille, 2020/04/01
- [PATCH 21/21] c++: replace symbol_number_type with symbol_type_type, Akim Demaille, 2020/04/01
- [PATCH 20/21] c++: also use symbol_type_type, Akim Demaille, 2020/04/01