757 |
|
|
758 |
static void |
static void |
759 |
yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate, |
yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate, |
760 |
yyGLRState* yyrhs, yyRuleNum yyrule) |
yyGLRState* rhs, yyRuleNum yyrule) |
761 |
{ |
{ |
762 |
yySemanticOption* yynewItem; |
yySemanticOption* yynewItem; |
763 |
yynewItem = &yystack->yynextFree->yyoption; |
yynewItem = &yystack->yynextFree->yyoption; |
764 |
yystack->yyspaceLeft -= 1; |
yystack->yyspaceLeft -= 1; |
765 |
yystack->yynextFree += 1; |
yystack->yynextFree += 1; |
766 |
yynewItem->yyisState = yyfalse; |
yynewItem->yyisState = yyfalse; |
767 |
yynewItem->yystate = yyrhs; |
yynewItem->yystate = rhs; |
768 |
yynewItem->yyrule = yyrule; |
yynewItem->yyrule = yyrule; |
769 |
yynewItem->yynext = yystate->yysemantics.yyfirstVal; |
yynewItem->yynext = yystate->yysemantics.yyfirstVal; |
770 |
yystate->yysemantics.yyfirstVal = yynewItem; |
yystate->yysemantics.yyfirstVal = yynewItem; |
967 |
* the (unresolved) semantic value of RHS under the action for RULE. */ |
* the (unresolved) semantic value of RHS under the action for RULE. */ |
968 |
static inline void |
static inline void |
969 |
yyglrShiftDefer (yyGLRStack* yystack, int yyk, yyStateNum yylrState, |
yyglrShiftDefer (yyGLRStack* yystack, int yyk, yyStateNum yylrState, |
970 |
size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule) |
size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule) |
971 |
{ |
{ |
972 |
yyGLRStackItem* yynewItem; |
yyGLRStackItem* yynewItem; |
973 |
|
|
981 |
yystack->yytops.yystates[yyk] = &yynewItem->yystate; |
yystack->yytops.yystates[yyk] = &yynewItem->yystate; |
982 |
yystack->yynextFree += 1; |
yystack->yynextFree += 1; |
983 |
yystack->yyspaceLeft -= 1; |
yystack->yyspaceLeft -= 1; |
984 |
yyaddDeferredAction (yystack, &yynewItem->yystate, yyrhs, yyrule); |
yyaddDeferredAction (yystack, &yynewItem->yystate, rhs, yyrule); |
985 |
} |
} |
986 |
|
|
987 |
/** Pop the symbols consumed by reduction #RULE from the top of stack |
/** Pop the symbols consumed by reduction #RULE from the top of stack |
999 |
if (yystack->yysplitPoint == NULL) |
if (yystack->yysplitPoint == NULL) |
1000 |
{ |
{ |
1001 |
/* Standard special case: single stack. */ |
/* Standard special case: single stack. */ |
1002 |
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk]; |
yyGLRStackItem* rhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk]; |
1003 |
assert (yyk == 0); |
assert (yyk == 0); |
1004 |
yystack->yynextFree -= yynrhs; |
yystack->yynextFree -= yynrhs; |
1005 |
yystack->yyspaceLeft += yynrhs; |
yystack->yyspaceLeft += yynrhs; |
1011 |
} |
} |
1012 |
else |
else |
1013 |
{ |
{ |
1014 |
*yyvalp = yyrhs[1-yynrhs].yystate.yysemantics.yysval; |
*yyvalp = rhs[1-yynrhs].yystate.yysemantics.yysval; |
1015 |
*yylocp = yyrhs[1-yynrhs].yystate.yyloc; |
*yylocp = rhs[1-yynrhs].yystate.yyloc; |
1016 |
} |
} |
1017 |
return yyuserAction (yyrule, yynrhs, yyrhs, yyvalp, yylocp, yystack); |
return yyuserAction (yyrule, yynrhs, rhs, yyvalp, yylocp, yystack); |
1018 |
} |
} |
1019 |
else |
else |
1020 |
{ |
{ |
1273 |
} |
} |
1274 |
|
|
1275 |
#if YYDEBUG |
#if YYDEBUG |
1276 |
|
/* FIXME: How can we initialize the lloc bit? */ |
1277 |
static yyGLRState YYLEFTMOST_STATE = { 0, 0, -1, NULL, 0, { NULL } }; |
static yyGLRState YYLEFTMOST_STATE = { 0, 0, -1, NULL, 0, { NULL } }; |
1278 |
|
|
1279 |
static void yyreportTree (yySemanticOption* yyx, int yyindent) |
static void yyreportTree (yySemanticOption* yyx, int yyindent) |