mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 02:03:03 +00:00
(yyfillin): Renamed from the old yyfill. Mark
as possibly unused. (yyfill): New function. (YYFILL): Use it. (yyuserAction): Change type of yynormal to bool, so that it matches the new yyfill signature. Mark it as possibly unused.
This commit is contained in:
27
data/glr.c
27
data/glr.c
@@ -615,9 +615,10 @@ yytokenName (yySymbol yytoken)
|
|||||||
/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
|
/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
|
||||||
* at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
|
* at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
|
||||||
* containing the pointer to the next state in the chain. Assumes
|
* containing the pointer to the next state in the chain. Assumes
|
||||||
* YYLOW1 < YYLOW0. For convenience, returns YYLOW1. */
|
* YYLOW1 < YYLOW0. */
|
||||||
static int
|
static void yyfillin (yyGLRStackItem *, int, int) ATTRIBUTE_UNUSED;
|
||||||
yyfill (yyGLRStackItem* yyvsp, int yylow0, int yylow1)
|
static void
|
||||||
|
yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
||||||
{
|
{
|
||||||
yyGLRState* s;
|
yyGLRState* s;
|
||||||
int i;
|
int i;
|
||||||
@@ -631,6 +632,21 @@ yyfill (yyGLRStackItem* yyvsp, int yylow0, int yylow1)
|
|||||||
yyvsp[i].yystate.yyloc = s->yyloc;
|
yyvsp[i].yystate.yyloc = s->yyloc;
|
||||||
s = yyvsp[i].yystate.yypred = s->yypred;
|
s = yyvsp[i].yystate.yypred = s->yypred;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in
|
||||||
|
YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
|
||||||
|
For convenience, always return YYLOW1. */
|
||||||
|
static inline int yyfill (yyGLRStackItem *, int *, int, yybool)
|
||||||
|
ATTRIBUTE_UNUSED;
|
||||||
|
static inline int
|
||||||
|
yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
|
||||||
|
{
|
||||||
|
if (!yynormal && yylow1 < *yylow)
|
||||||
|
{
|
||||||
|
yyfillin (yyvsp, *yylow, yylow1);
|
||||||
|
*yylow = yylow1;
|
||||||
|
}
|
||||||
return yylow1;
|
return yylow1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,7 +660,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
|
|||||||
YYSTYPE* yyvalp, YYLTYPE* yylocp, yyGLRStack* yystack
|
YYSTYPE* yyvalp, YYLTYPE* yylocp, yyGLRStack* yystack
|
||||||
]b4_user_formals[)
|
]b4_user_formals[)
|
||||||
{
|
{
|
||||||
int yynormal = (yystack->yysplitPoint == NULL);
|
yybool yynormal ATTRIBUTE_UNUSED = (yystack->yysplitPoint == NULL);
|
||||||
int yylow;
|
int yylow;
|
||||||
|
|
||||||
if (yyrhslen == 0)
|
if (yyrhslen == 0)
|
||||||
@@ -670,8 +686,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
|
|||||||
# undef yyclearin
|
# undef yyclearin
|
||||||
# define yyclearin (yychar = *(yystack->yytokenp) = YYEMPTY)
|
# define yyclearin (yychar = *(yystack->yytokenp) = YYEMPTY)
|
||||||
# undef YYFILL
|
# undef YYFILL
|
||||||
# define YYFILL(N) \
|
# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
|
||||||
((yynormal || yylow <= (N)) ? (N) : (yylow = yyfill (yyvsp, yylow, N)))
|
|
||||||
# undef YYBACKUP
|
# undef YYBACKUP
|
||||||
# define YYBACKUP(Token, Value) \
|
# define YYBACKUP(Token, Value) \
|
||||||
do { \
|
do { \
|
||||||
|
|||||||
Reference in New Issue
Block a user