mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
(YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do not define to
{}, since this breaks the common use of `YYDPRINTF ((...));' if a
single statement is desired (e.g. before `else'). Work around GCC
warnings by surrounding corresponding calls with {} if needed.
(yyhasResolvedValue): Remove unused function.
(yymergeOptionSets, yyresolvStack): Use `continue;' for empty
loop body.
(yyreportSyntaxError): Renamed from yyreportParseError.
(yyrecoverSyntaxError): Renamed from yyrecoverParseError.
All uses changed.
This commit is contained in:
42
data/glr.c
42
data/glr.c
@@ -481,9 +481,9 @@ int yydebug;
|
|||||||
#else /* !YYDEBUG */
|
#else /* !YYDEBUG */
|
||||||
|
|
||||||
/* Avoid empty `if' bodies. */
|
/* Avoid empty `if' bodies. */
|
||||||
# define YYDPRINTF(Args) {}
|
# define YYDPRINTF(Args)
|
||||||
# define YYDSYMPRINT(Args) {}
|
# define YYDSYMPRINT(Args)
|
||||||
# define YYDSYMPRINTF(Title, Token, Value, Location) {}
|
# define YYDSYMPRINTF(Title, Token, Value, Location)
|
||||||
|
|
||||||
#endif /* !YYDEBUG */
|
#endif /* !YYDEBUG */
|
||||||
|
|
||||||
@@ -790,14 +790,6 @@ yyisErrorAction (int yyaction)
|
|||||||
|
|
||||||
/* GLRStates */
|
/* GLRStates */
|
||||||
|
|
||||||
/** True iff the semantic value of the edge leading to STATE is
|
|
||||||
* resolved. */
|
|
||||||
static inline bool
|
|
||||||
yyhasResolvedValue (yyGLRState* yystate)
|
|
||||||
{
|
|
||||||
return yystate->yyresolved;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate,
|
yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate,
|
||||||
yyGLRState* rhs, yyRuleNum yyrule]b4_pure_formals[)
|
yyGLRState* rhs, yyRuleNum yyrule]b4_pure_formals[)
|
||||||
@@ -967,14 +959,18 @@ yyremoveDeletes (yyGLRStack* yystack)
|
|||||||
if (yystack->yytops.yystates[yyi] == NULL)
|
if (yystack->yytops.yystates[yyi] == NULL)
|
||||||
{
|
{
|
||||||
if (yyi == yyj)
|
if (yyi == yyj)
|
||||||
YYDPRINTF ((stderr, "Removing dead stacks.\n"));
|
{
|
||||||
|
YYDPRINTF ((stderr, "Removing dead stacks.\n"));
|
||||||
|
}
|
||||||
yystack->yytops.yysize -= 1;
|
yystack->yytops.yysize -= 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];
|
yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];
|
||||||
if (yyj != yyi)
|
if (yyj != yyi)
|
||||||
YYDPRINTF ((stderr, "Rename stack %d -> %d.\n", yyi, yyj));
|
{
|
||||||
|
YYDPRINTF ((stderr, "Rename stack %d -> %d.\n", yyi, yyj));
|
||||||
|
}
|
||||||
yyj += 1;
|
yyj += 1;
|
||||||
}
|
}
|
||||||
yyi += 1;
|
yyi += 1;
|
||||||
@@ -1250,7 +1246,7 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
|
|||||||
yySemanticOption* yyz;
|
yySemanticOption* yyz;
|
||||||
for (yyz = yys0->yysemantics.yyfirstVal; yyz->yynext != NULL;
|
for (yyz = yys0->yysemantics.yyfirstVal; yyz->yynext != NULL;
|
||||||
yyz = yyz->yynext)
|
yyz = yyz->yynext)
|
||||||
;
|
continue;
|
||||||
yyz->yynext = yys1->yysemantics.yyfirstVal;
|
yyz->yynext = yys1->yysemantics.yyfirstVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1460,7 +1456,7 @@ yyresolveStack (yyGLRStack* yystack]b4_user_formals[)
|
|||||||
for (yyn = 0, yys = yystack->yytops.yystates[0];
|
for (yyn = 0, yys = yystack->yytops.yystates[0];
|
||||||
yys != yystack->yysplitPoint;
|
yys != yystack->yysplitPoint;
|
||||||
yys = yys->yypred, yyn += 1)
|
yys = yys->yypred, yyn += 1)
|
||||||
;
|
continue;
|
||||||
YYCHK (yyresolveStates (yystack->yytops.yystates[0], yyn, yystack
|
YYCHK (yyresolveStates (yystack->yytops.yystates[0], yyn, yystack
|
||||||
]b4_user_args[));
|
]b4_user_args[));
|
||||||
}
|
}
|
||||||
@@ -1571,8 +1567,8 @@ yyprocessOneStack (yyGLRStack* yystack, int yyk,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
yyreportParseError (yyGLRStack* yystack,
|
yyreportSyntaxError (yyGLRStack* yystack,
|
||||||
YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)
|
YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)
|
||||||
{
|
{
|
||||||
/* `Unused' warnings. */
|
/* `Unused' warnings. */
|
||||||
(void) yylvalp;
|
(void) yylvalp;
|
||||||
@@ -1630,8 +1626,8 @@ yyreportParseError (yyGLRStack* yystack,
|
|||||||
YYLVALP, and YYLLOCP point to the syntactic category, semantic
|
YYLVALP, and YYLLOCP point to the syntactic category, semantic
|
||||||
value, and location of the lookahead. */
|
value, and location of the lookahead. */
|
||||||
static void
|
static void
|
||||||
yyrecoverParseError (yyGLRStack* yystack,
|
yyrecoverSyntaxError (yyGLRStack* yystack,
|
||||||
YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)
|
YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)
|
||||||
{
|
{
|
||||||
yySymbol* const yytokenp = yystack->yytokenp;
|
yySymbol* const yytokenp = yystack->yytokenp;
|
||||||
size_t yyk;
|
size_t yyk;
|
||||||
@@ -1796,7 +1792,7 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
yyrule = yydefaultAction (yystate);
|
yyrule = yydefaultAction (yystate);
|
||||||
if (yyrule == 0)
|
if (yyrule == 0)
|
||||||
{
|
{
|
||||||
yyreportParseError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
yyreportSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
||||||
goto yyuser_error;
|
goto yyuser_error;
|
||||||
}
|
}
|
||||||
YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue]b4_lpure_args[));
|
YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue]b4_lpure_args[));
|
||||||
@@ -1827,7 +1823,7 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
}
|
}
|
||||||
else if (yyisErrorAction (yyaction))
|
else if (yyisErrorAction (yyaction))
|
||||||
{
|
{
|
||||||
yyreportParseError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
yyreportSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
||||||
goto yyuser_error;
|
goto yyuser_error;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1852,7 +1848,7 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
yyFail (&yystack][]b4_lpure_args[, "syntax error");
|
yyFail (&yystack][]b4_lpure_args[, "syntax error");
|
||||||
YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
|
YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
|
||||||
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
|
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
|
||||||
yyreportParseError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
yyreportSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
||||||
goto yyuser_error;
|
goto yyuser_error;
|
||||||
}
|
}
|
||||||
else if (yystack.yytops.yysize == 1)
|
else if (yystack.yytops.yysize == 1)
|
||||||
@@ -1865,7 +1861,7 @@ yyrecoverParseError (yyGLRStack* yystack,
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
yyuser_error:
|
yyuser_error:
|
||||||
yyrecoverParseError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
yyrecoverSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
|
||||||
yyposn = yystack.yytops.yystates[0]->yyposn;
|
yyposn = yystack.yytops.yystates[0]->yyposn;
|
||||||
}
|
}
|
||||||
yyDone:
|
yyDone:
|
||||||
|
|||||||
Reference in New Issue
Block a user