mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
glr.c: comment changes
* data/skeletons/glr.c (yycompressStack): Reduce scope, and import some nice comments from glr2.cc.
This commit is contained in:
@@ -1967,18 +1967,24 @@ yyresolveStack (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
return yyok;
|
return yyok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Called when returning to deterministic operation to clean up the extra
|
||||||
|
* stacks. */
|
||||||
static void
|
static void
|
||||||
yycompressStack (yyGLRStack* yystackp)
|
yycompressStack (yyGLRStack* yystackp)
|
||||||
{
|
{
|
||||||
yyGLRState* yyp, *yyq, *yyr;
|
/* yyr is the state after the split point. */
|
||||||
|
yyGLRState *yyr;
|
||||||
|
|
||||||
if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR)
|
if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR;
|
{
|
||||||
yyp != yystackp->yysplitPoint;
|
yyGLRState *yyp, *yyq;
|
||||||
yyr = yyp, yyp = yyq, yyq = yyp->yypred)
|
for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR;
|
||||||
yyp->yypred = yyr;
|
yyp != yystackp->yysplitPoint;
|
||||||
|
yyr = yyp, yyp = yyq, yyq = yyp->yypred)
|
||||||
|
yyp->yypred = yyr;
|
||||||
|
}
|
||||||
|
|
||||||
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
|
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
|
||||||
yystackp->yynextFree = YY_REINTERPRET_CAST (yyGLRStackItem*, yystackp->yysplitPoint) + 1;
|
yystackp->yynextFree = YY_REINTERPRET_CAST (yyGLRStackItem*, yystackp->yysplitPoint) + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user