summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-04-26 14:48:13 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-04-26 14:49:26 +0200
commit1c3d79b8715c6433d8d963563b35743ef64a0f9e (patch)
treecd11564c77fcb773bb67a535faa546dcce89fca2
parent9c72d3c5a8e2267c1065b2c9ac46a1ec87a8941d (diff)
downloadbison-1c3d79b8715c6433d8d963563b35743ef64a0f9e.tar.gz
style: glr.c: clarify
* data/skeletons/glr.c: Make the code a bit clearer.
-rw-r--r--data/skeletons/glr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/data/skeletons/glr.c b/data/skeletons/glr.c
index 39d4071f..5686e0b3 100644
--- a/data/skeletons/glr.c
+++ b/data/skeletons/glr.c
@@ -2034,7 +2034,7 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
const int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
- while (*yyconflicts != 0)
+ for (/* nothing */; *yyconflicts; yyconflicts += 1)
{
YYRESULTTAG yyflag;
ptrdiff_t yynewStack = yysplitStack (yystackp, yyk);
@@ -2053,7 +2053,6 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
}
else
return yyflag;
- yyconflicts += 1;
}
if (yyisShiftAction (yyaction))
@@ -2450,7 +2449,7 @@ b4_dollar_popdef])[]dnl
/* For efficiency, we have two loops, the first of which is
specialized to deterministic operation (single stack, no
potential ambiguity). */
- /* Standard mode */
+ /* Standard mode. */
while (yytrue)
{
yy_state_t yystate = yystack.yytops.yystates[0]->yylrState;
@@ -2473,7 +2472,8 @@ b4_dollar_popdef])[]dnl
yysymbol_kind_t yytoken = ]b4_yygetToken_call;[
const short* yyconflicts;
int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
- if (*yyconflicts != 0)
+ if (*yyconflicts)
+ /* Enter nondeterministic mode. */
break;
if (yyisShiftAction (yyaction))
{
@@ -2499,6 +2499,7 @@ b4_dollar_popdef])[]dnl
}
}
+ /* Nondeterministic mode. */
while (yytrue)
{
yysymbol_kind_t yytoken_to_shift;