# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
# symbols on RHS.
m4_define([b4_rhs_value],
-[yyvsp@{YYFILL (m4_eval([$2 - $1]))@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3])])
+[((yyGLRStackItem const *)yyvsp)@{YYFILL (m4_eval([$2 - $1]))@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3])])
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
# on RHS.
m4_define([b4_rhs_location],
-[yyvsp@{YYFILL (m4_eval([$2 - $1]))@}.yystate.yyloc])
+[((yyGLRStackItem const *)yyvsp)@{YYFILL (m4_eval([$2 - $1]))@}.yystate.yyloc])
# We do want M4 expansion after # for CPP macros.
m4_changecom()
# endif
#endif
+#ifndef YYASSERT
+# define YYASSERT(condition) ((void) ((condition) || (abort (), 0)))
+#endif
+
#ifndef ATTRIBUTE_UNUSED
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif
s = yyvsp[yylow0].yystate.yypred;
for (i = yylow0-1; i >= yylow1; i -= 1)
{
- if (! s->yyresolved)
- abort ();
+ YYASSERT (s->yyresolved);
yyvsp[i].yystate.yyresolved = yytrue;
yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;
yyvsp[i].yystate.yyloc = s->yyloc;
}
\f
-static YYSTYPE
+static void
yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
{
- YYSTYPE yyval = *yy0;
/* `Use' the arguments. */
(void) yy0;
(void) yy1;
{
b4_mergers
}
- return yyval;
}
[
/* Bison grammar-table manipulation. */
{
/* Standard special case: single stack. */
yyGLRStackItem* rhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk];
- if (yyk != 0)
- abort ();
+ YYASSERT (yyk == 0);
yystack->yynextFree -= yynrhs;
yystack->yyspaceLeft += yynrhs;
yystack->yytops.yystates[0] = & yystack->yynextFree[-1].yystate;
for (yyi = 0; yyi < yynrhs; yyi += 1)
{
yys = yys->yypred;
- if (yys == NULL)
- abort ();
+ YYASSERT (yys);
}
yyupdateSplit (yystack, yys);
yystack->yytops.yystates[yyk] = yys;
0 < yyn; yyn -= 1)
{
yys = yys->yypred;
- if (yys == NULL)
- abort ();
+ YYASSERT (yys);
}
yyupdateSplit (yystack, yys);
yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
YYDPRINTF ((stderr,
- "Reduced stack %lu by rule #%d; action deferred. "
- "Now in state %d.\n",
+ "Reduced stack %lu by rule #%d; action deferred. Now in state %d.\n",
(unsigned long int) yyk, yyrule - 1, yynewLRState));
for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
if (yyi != yyk && yystack->yytops.yystates[yyi] != NULL)
{
if (yystack->yysplitPoint == NULL)
{
- if (yyk != 0)
- abort ();
+ YYASSERT (yyk == 0);
yystack->yysplitPoint = yystack->yytops.yystates[yyk];
}
if (yystack->yytops.yysize >= yystack->yytops.yycapacity)
YYRESULTTAG yyflag;
if (0 < yyn)
{
- if (yys->yypred == NULL)
- abort ();
+ YYASSERT (yys->yypred);
yyflag = yyresolveStates (yys->yypred, yyn-1, yystack]b4_user_args[);
if (yyflag != yyok)
return yyflag;
YYSTYPE yyval1;
YYLTYPE yydummy;
YYCHK (yyresolveAction (yyp, yystack, &yyval1, &yydummy]b4_user_args[));
- *yyvalp = yyuserMerge (yymerger[yyp->yyrule], yyvalp, &yyval1);
+ yyuserMerge (yymerger[yyp->yyrule], yyvalp, &yyval1);
}
}
return yyok;
yyStateNum yystate = yystack->yytops.yystates[yyk]->yylrState;
YYDPRINTF ((stderr, "Stack %d Entering state %d\n", yyk, yystate));
- if (yystate == YYFINAL)
- abort ();
+ YYASSERT (yystate != YYFINAL);
+
if (yyisDefaultedState (yystate))
{
yyrule = yydefaultAction (yystate);