mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-26 20:53:04 +00:00
(YYLEFTMOST_STATE): Remove.
(yyreportTree): Use a stack-based leftmost state. This avoids our continuing battles with bogus warnings about initializers.
This commit is contained in:
17
data/glr.c
17
data/glr.c
@@ -1284,17 +1284,6 @@ yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystack,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if YYDEBUG
|
#if YYDEBUG
|
||||||
static yyGLRState YYLEFTMOST_STATE =
|
|
||||||
{
|
|
||||||
0, 0, -1, NULL, 0, { NULL },
|
|
||||||
/* yyloc. */
|
|
||||||
{
|
|
||||||
#if YYLTYPE_IS_TRIVIAL
|
|
||||||
]b4_location_if([ 0, 0, 0, 0])[
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
yyreportTree (yySemanticOption* yyx, int yyindent)
|
yyreportTree (yySemanticOption* yyx, int yyindent)
|
||||||
{
|
{
|
||||||
@@ -1302,11 +1291,15 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
|
|||||||
int yyi;
|
int yyi;
|
||||||
yyGLRState* yys;
|
yyGLRState* yys;
|
||||||
yyGLRState* yystates[YYMAXRHS];
|
yyGLRState* yystates[YYMAXRHS];
|
||||||
|
yyGLRState yyleftmost_state;
|
||||||
|
|
||||||
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
|
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
|
||||||
yystates[yyi] = yys;
|
yystates[yyi] = yys;
|
||||||
if (yys == NULL)
|
if (yys == NULL)
|
||||||
yystates[0] = &YYLEFTMOST_STATE;
|
{
|
||||||
|
yyleftmost_state.yyposn = 0;
|
||||||
|
yystates[0] = &yyleftmost_state;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
yystates[0] = yys;
|
yystates[0] = yys;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user