Flex also defines YY_NULL (to 0). Avoid gratuitous conflicts.
* data/c.m4 (b4_null_define): Rename YY_NULL as YY_NULLPTR.
* data/glr.c, data/lalr1.cc, data/location.cc, data/variant.hh,
* data/yacc.c, src/parse-gram.c, tests/actions.at, tests/c++.at,
* tests/cxx-type.at, tests/glr-regression.at, tests/headers.at,
* tests/push.at, tests/regression.at:
Adjust.
14 files changed:
# b4_null_define
# --------------
# b4_null_define
# --------------
-# Portability issues: define a YY_NULL appropriate for the current
+# Portability issues: define a YY_NULLPTR appropriate for the current
# language (C, C++98, or C++11).
m4_define([b4_null_define],
# language (C, C++98, or C++11).
m4_define([b4_null_define],
# if defined __cplusplus && 201103L <= __cplusplus
# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULL nullptr
+# define YY_NULLPTR nullptr
# b4_null
# -------
# Return a null pointer constant.
# b4_null
# -------
# Return a null pointer constant.
-m4_define([b4_null], [YY_NULL])
+m4_define([b4_null], [YY_NULLPTR])
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
# -------------------------------------------------------------
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
# -------------------------------------------------------------
static _Noreturn void
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
{
static _Noreturn void
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
{
+ if (yymsg != YY_NULLPTR)
yyerror (]b4_yyerror_args[yymsg);
YYLONGJMP (yystackp->yyexception_buffer, 1);
}
yyerror (]b4_yyerror_args[yymsg);
YYLONGJMP (yystackp->yyexception_buffer, 1);
}
else
/* The effect of using yysval or yyloc (in an immediate rule) is
* undefined. */
else
/* The effect of using yysval or yyloc (in an immediate rule) is
* undefined. */
- yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULL;]b4_locations_if([[
+ yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULLPTR;]b4_locations_if([[
yyvsp[i].yystate.yyloc = s->yyloc;]])[
s = yyvsp[i].yystate.yypred = s->yypred;
}
yyvsp[i].yystate.yyloc = s->yyloc;]])[
s = yyvsp[i].yystate.yypred = s->yypred;
}
yyGLRStack* yystackp,
YYSTYPE* yyvalp]b4_locuser_formals[)
{
yyGLRStack* yystackp,
YYSTYPE* yyvalp]b4_locuser_formals[)
{
- yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULL);
+ yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULLPTR);
int yylow;
]b4_parse_param_use([yyvalp], [yylocp])dnl
[ YYUSE (yyrhslen);
int yylow;
]b4_parse_param_use([yyvalp], [yylocp])dnl
[ YYUSE (yyrhslen);
YYFPRINTF (stderr, "%s unresolved", yymsg);
else
YYFPRINTF (stderr, "%s incomplete", yymsg);
YYFPRINTF (stderr, "%s unresolved", yymsg);
else
YYFPRINTF (stderr, "%s incomplete", yymsg);
- YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULL, &yys->yyloc);
+ YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc);
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
if (! yyset->yystates)
return yyfalse;
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
if (! yyset->yystates)
return yyfalse;
- yyset->yystates[0] = YY_NULL;
+ yyset->yystates[0] = YY_NULLPTR;
yyset->yylookaheadNeeds =
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
if (! yyset->yylookaheadNeeds)
yyset->yylookaheadNeeds =
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
if (! yyset->yylookaheadNeeds)
if (!yystackp->yyitems)
return yyfalse;
yystackp->yynextFree = yystackp->yyitems;
if (!yystackp->yyitems)
return yyfalse;
yystackp->yynextFree = yystackp->yyitems;
- yystackp->yysplitPoint = YY_NULL;
- yystackp->yylastDeleted = YY_NULL;
+ yystackp->yysplitPoint = YY_NULLPTR;
+ yystackp->yylastDeleted = YY_NULLPTR;
return yyinitStateSet (&yystackp->yytops);
}
return yyinitStateSet (&yystackp->yytops);
}
{
yyGLRState* yys0 = &yyp0->yystate;
yyGLRState* yys1 = &yyp1->yystate;
{
yyGLRState* yys0 = &yyp0->yystate;
yyGLRState* yys1 = &yyp1->yystate;
- if (yys0->yypred != YY_NULL)
+ if (yys0->yypred != YY_NULLPTR)
yys1->yypred =
YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
yys1->yypred =
YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
- if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULL)
+ if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULLPTR)
yys1->yysemantics.yyfirstVal =
YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
}
yys1->yysemantics.yyfirstVal =
YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
}
{
yySemanticOption* yyv0 = &yyp0->yyoption;
yySemanticOption* yyv1 = &yyp1->yyoption;
{
yySemanticOption* yyv0 = &yyp0->yyoption;
yySemanticOption* yyv1 = &yyp1->yyoption;
- if (yyv0->yystate != YY_NULL)
+ if (yyv0->yystate != YY_NULLPTR)
yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
- if (yyv0->yynext != YY_NULL)
+ if (yyv0->yynext != YY_NULLPTR)
yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
}
}
yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
}
}
- if (yystackp->yysplitPoint != YY_NULL)
+ if (yystackp->yysplitPoint != YY_NULLPTR)
yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
yystackp->yysplitPoint, yystate);
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
yystackp->yysplitPoint, yystate);
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
- if (yystackp->yytops.yystates[yyn] != YY_NULL)
+ if (yystackp->yytops.yystates[yyn] != YY_NULLPTR)
yystackp->yytops.yystates[yyn] =
YYRELOC (yystackp->yyitems, yynewItems,
yystackp->yytops.yystates[yyn], yystate);
yystackp->yytops.yystates[yyn] =
YYRELOC (yystackp->yyitems, yynewItems,
yystackp->yytops.yystates[yyn], yystate);
static inline void
yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
{
static inline void
yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
{
- if (yystackp->yysplitPoint != YY_NULL && yystackp->yysplitPoint > yys)
+ if (yystackp->yysplitPoint != YY_NULLPTR && yystackp->yysplitPoint > yys)
yystackp->yysplitPoint = yys;
}
yystackp->yysplitPoint = yys;
}
static inline void
yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
{
static inline void
yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
{
- if (yystackp->yytops.yystates[yyk] != YY_NULL)
+ if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
- yystackp->yytops.yystates[yyk] = YY_NULL;
+ yystackp->yytops.yystates[yyk] = YY_NULLPTR;
}
/** Undelete the last stack in *YYSTACKP that was marked as deleted. Can
}
/** Undelete the last stack in *YYSTACKP that was marked as deleted. Can
static void
yyundeleteLastStack (yyGLRStack* yystackp)
{
static void
yyundeleteLastStack (yyGLRStack* yystackp)
{
- if (yystackp->yylastDeleted == YY_NULL || yystackp->yytops.yysize != 0)
+ if (yystackp->yylastDeleted == YY_NULLPTR || yystackp->yytops.yysize != 0)
return;
yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
yystackp->yytops.yysize = 1;
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
return;
yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
yystackp->yytops.yysize = 1;
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
- yystackp->yylastDeleted = YY_NULL;
+ yystackp->yylastDeleted = YY_NULLPTR;
yyi = yyj = 0;
while (yyj < yystackp->yytops.yysize)
{
yyi = yyj = 0;
while (yyj < yystackp->yytops.yysize)
{
- if (yystackp->yytops.yystates[yyi] == YY_NULL)
+ if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
yynewState->yyposn = yyposn;
yynewState->yyresolved = yyfalse;
yynewState->yypred = yystackp->yytops.yystates[yyk];
yynewState->yyposn = yyposn;
yynewState->yyresolved = yyfalse;
yynewState->yypred = yystackp->yytops.yystates[yyk];
- yynewState->yysemantics.yyfirstVal = YY_NULL;
+ yynewState->yysemantics.yyfirstVal = YY_NULLPTR;
yystackp->yytops.yystates[yyk] = yynewState;
/* Invokes YY_RESERVE_GLRSTACK. */
yystackp->yytops.yystates[yyk] = yynewState;
/* Invokes YY_RESERVE_GLRSTACK. */
{
int yynrhs = yyrhsLength (yyrule);
{
int yynrhs = yyrhsLength (yyrule);
- if (yystackp->yysplitPoint == YY_NULL)
+ if (yystackp->yysplitPoint == YY_NULLPTR)
{
/* Standard special case: single stack. */
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
{
/* Standard special case: single stack. */
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
{
size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
{
size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
- if (yyforceEval || yystackp->yysplitPoint == YY_NULL)
+ if (yyforceEval || yystackp->yysplitPoint == YY_NULLPTR)
{
YYSTYPE yysval;]b4_locations_if([[
YYLTYPE yyloc;]])[
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
{
YYSTYPE yysval;]b4_locations_if([[
YYLTYPE yyloc;]])[
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
- if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULL)
+ if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
{
YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
(unsigned long int) yyk, yyrule - 1));
{
YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
(unsigned long int) yyk, yyrule - 1));
"Now in state %d.\n",
(unsigned long int) yyk, yyrule - 1, yynewLRState));
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
"Now in state %d.\n",
(unsigned long int) yyk, yyrule - 1, yynewLRState));
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
- if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULL)
+ if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR)
{
yyGLRState *yysplit = yystackp->yysplitPoint;
yyGLRState *yyp = yystackp->yytops.yystates[yyi];
{
yyGLRState *yysplit = yystackp->yysplitPoint;
yyGLRState *yyp = yystackp->yytops.yystates[yyi];
static size_t
yysplitStack (yyGLRStack* yystackp, size_t yyk)
{
static size_t
yysplitStack (yyGLRStack* yystackp, size_t yyk)
{
- if (yystackp->yysplitPoint == YY_NULL)
+ if (yystackp->yysplitPoint == YY_NULLPTR)
{
YYASSERT (yyk == 0);
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
{
YYASSERT (yyk == 0);
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
yyGLRState** yynewStates;
yybool* yynewLookaheadNeeds;
yyGLRState** yynewStates;
yybool* yynewLookaheadNeeds;
+ yynewStates = YY_NULLPTR;
if (yystackp->yytops.yycapacity
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
if (yystackp->yytops.yycapacity
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
(yystackp->yytops.yycapacity
* sizeof yynewStates[0]));
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
(yystackp->yytops.yycapacity
* sizeof yynewStates[0]));
- if (yynewStates == YY_NULL)
+ if (yynewStates == YY_NULLPTR)
yyMemoryExhausted (yystackp);
yystackp->yytops.yystates = yynewStates;
yyMemoryExhausted (yystackp);
yystackp->yytops.yystates = yynewStates;
(yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
(yystackp->yytops.yycapacity
* sizeof yynewLookaheadNeeds[0]));
(yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
(yystackp->yytops.yycapacity
* sizeof yynewLookaheadNeeds[0]));
- if (yynewLookaheadNeeds == YY_NULL)
+ if (yynewLookaheadNeeds == YY_NULLPTR)
yyMemoryExhausted (yystackp);
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
}
yyMemoryExhausted (yystackp);
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
}
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
while (yytrue)
{
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
while (yytrue)
{
- if (yyz1 == *yyz0p || yyz1 == YY_NULL)
+ if (yyz1 == *yyz0p || yyz1 == YY_NULLPTR)
- else if (*yyz0p == YY_NULL)
+ else if (*yyz0p == YY_NULLPTR)
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
yystates[yyi] = yys;
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
yystates[yyi] = yys;
{
yyleftmost_state.yyposn = 0;
yystates[0] = &yyleftmost_state;
{
yyleftmost_state.yyposn = 0;
yystates[0] = &yyleftmost_state;
yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
int yynrhs;
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
int yynrhs;
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
- YYASSERT (yyoption != YY_NULL);
+ YYASSERT (yyoption != YY_NULLPTR);
yynrhs = yyrhsLength (yyoption->yyrule);
if (yynrhs > 0)
{
yynrhs = yyrhsLength (yyoption->yyrule);
if (yynrhs > 0)
{
YYRESULTTAG yyflag;]b4_locations_if([
YYLTYPE *yylocp = &yys->yyloc;])[
YYRESULTTAG yyflag;]b4_locations_if([
YYLTYPE *yylocp = &yys->yyloc;])[
- for (yypp = &yyoptionList->yynext; *yypp != YY_NULL; )
+ for (yypp = &yyoptionList->yynext; *yypp != YY_NULLPTR; )
{
yySemanticOption* yyp = *yypp;
{
yySemanticOption* yyp = *yypp;
int yyprec = yydprec[yybest->yyrule];
yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[);
if (yyflag == yyok)
int yyprec = yydprec[yybest->yyrule];
yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[);
if (yyflag == yyok)
- for (yyp = yybest->yynext; yyp != YY_NULL; yyp = yyp->yynext)
+ for (yyp = yybest->yynext; yyp != YY_NULLPTR; yyp = yyp->yynext)
{
if (yyprec == yydprec[yyp->yyrule])
{
{
if (yyprec == yydprec[yyp->yyrule])
{
yys->yysemantics.yysval = yysval;
}
else
yys->yysemantics.yysval = yysval;
}
else
- yys->yysemantics.yyfirstVal = YY_NULL;
+ yys->yysemantics.yyfirstVal = YY_NULLPTR;
return yyflag;
}
static YYRESULTTAG
yyresolveStack (yyGLRStack* yystackp]b4_user_formals[)
{
return yyflag;
}
static YYRESULTTAG
yyresolveStack (yyGLRStack* yystackp]b4_user_formals[)
{
- if (yystackp->yysplitPoint != YY_NULL)
+ if (yystackp->yysplitPoint != YY_NULLPTR)
{
yyGLRState* yys;
int yyn;
{
yyGLRState* yys;
int yyn;
{
yyGLRState* yyp, *yyq, *yyr;
{
yyGLRState* yyp, *yyq, *yyr;
- if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULL)
+ if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR)
- for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULL;
+ for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR;
yyp != yystackp->yysplitPoint;
yyr = yyp, yyp = yyq, yyq = yyp->yypred)
yyp->yypred = yyr;
yyp != yystackp->yysplitPoint;
yyr = yyp, yyp = yyq, yyq = yyp->yypred)
yyp->yypred = yyr;
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
- yystackp->yysplitPoint = YY_NULL;
- yystackp->yylastDeleted = YY_NULL;
+ yystackp->yysplitPoint = YY_NULLPTR;
+ yystackp->yylastDeleted = YY_NULLPTR;
+ while (yyr != YY_NULLPTR)
{
yystackp->yynextFree->yystate = *yyr;
yyr = yyr->yypred;
{
yystackp->yynextFree->yystate = *yyr;
yyr = yyr->yypred;
yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
size_t yyposn]b4_pure_formals[)
{
yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
size_t yyposn]b4_pure_formals[)
{
- while (yystackp->yytops.yystates[yyk] != YY_NULL)
+ while (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
{
yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
{
yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
#else
{
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
#else
{
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
- size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken));
+ size_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
size_t yysize = yysize0;
yybool yysize_overflow = yyfalse;
size_t yysize = yysize0;
yybool yysize_overflow = yyfalse;
+ char* yymsg = YY_NULLPTR;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = YY_NULL;
+ const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
}
yyarg[yycount++] = yytokenName (yyx);
{
}
yyarg[yycount++] = yytokenName (yyx);
{
- size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx));
+ size_t yysz = yysize + yytnamerr (YY_NULLPTR, yytokenName (yyx));
yysize_overflow |= yysz < yysize;
yysize = yysz;
}
yysize_overflow |= yysz < yysize;
yysize = yysz;
}
{
yySymbol yytoken;
if (yychar == YYEOF)
{
yySymbol yytoken;
if (yychar == YYEOF)
- yyFail (yystackp][]b4_lpure_args[, YY_NULL);
+ yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
if (yychar != YYEMPTY)
{]b4_locations_if([[
/* We throw away the lookahead, but the error range
if (yychar != YYEMPTY)
{]b4_locations_if([[
/* We throw away the lookahead, but the error range
/* Reduce to one stack. */
for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
/* Reduce to one stack. */
for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
- if (yystackp->yytops.yystates[yyk] != YY_NULL)
+ if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
break;
if (yyk >= yystackp->yytops.yysize)
break;
if (yyk >= yystackp->yytops.yysize)
- yyFail (yystackp][]b4_lpure_args[, YY_NULL);
+ yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
yymarkStackDeleted (yystackp, yyk);
yyremoveDeletes (yystackp);
for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
yymarkStackDeleted (yystackp, yyk);
yyremoveDeletes (yystackp);
/* Now pop stack until we find a state that shifts the error token. */
yystackp->yyerrState = 3;
/* Now pop stack until we find a state that shifts the error token. */
yystackp->yyerrState = 3;
- while (yystackp->yytops.yystates[0] != YY_NULL)
+ while (yystackp->yytops.yystates[0] != YY_NULLPTR)
{
yyGLRState *yys = yystackp->yytops.yystates[0];
yyj = yypact[yys->yylrState];
{
yyGLRState *yys = yystackp->yytops.yystates[0];
yyj = yypact[yys->yylrState];
}
}]b4_locations_if([[
yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[
}
}]b4_locations_if([[
yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[
- if (yys->yypred != YY_NULL)
+ if (yys->yypred != YY_NULLPTR)
yydestroyGLRState ("Error: popping", yys]b4_user_args[);
yystackp->yytops.yystates[0] = yys->yypred;
yystackp->yynextFree -= 1;
yystackp->yyspaceLeft += 1;
}
yydestroyGLRState ("Error: popping", yys]b4_user_args[);
yystackp->yytops.yystates[0] = yys->yypred;
yystackp->yynextFree -= 1;
yystackp->yyspaceLeft += 1;
}
- if (yystackp->yytops.yystates[0] == YY_NULL)
- yyFail (yystackp][]b4_lpure_args[, YY_NULL);
+ if (yystackp->yytops.yystates[0] == YY_NULLPTR)
+ yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
{
yyGLRState *yys = yystates[yyk];
]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
{
yyGLRState *yys = yystates[yyk];
]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
-)[ if (yys->yypred != YY_NULL)
+)[ if (yys->yypred != YY_NULLPTR)
yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[);
yystates[yyk] = yys->yypred;
yystack.yynextFree -= 1;
yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[);
yystates[yyk] = yys->yypred;
yystack.yynextFree -= 1;
static void
yypstates (yyGLRState* yyst)
{
static void
yypstates (yyGLRState* yyst)
{
+ if (yyst == YY_NULLPTR)
YYFPRINTF (stderr, "<null>");
else
yy_yypstack (yyst);
YYFPRINTF (stderr, "<null>");
else
yy_yypstack (yyst);
- ((YYX) == YY_NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
+ ((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
location values to have been already stored, initialize these
stacks with a primary value. */
yystack_.clear ();
location values to have been already stored, initialize these
stacks with a primary value. */
yystack_.clear ();
- yypush_ (YY_NULL, 0, yyla);
+ yypush_ (YY_NULLPTR, 0, yyla);
// A new symbol was pushed on the stack.
yynewstate:
// A new symbol was pushed on the stack.
yynewstate:
YY_STACK_PRINT ();
// Shift the result of the reduction.
YY_STACK_PRINT ();
// Shift the result of the reduction.
- yypush_ (YY_NULL, yylhs);
+ yypush_ (YY_NULLPTR, yylhs);
goto yynewstate;
/*--------------------------------------.
goto yynewstate;
/*--------------------------------------.
// Do not try to display the values of the reclaimed symbols,
// as their printer might throw an exception.
if (!yyempty)
// Do not try to display the values of the reclaimed symbols,
// as their printer might throw an exception.
if (!yyempty)
- yy_destroy_ (YY_NULL, yyla);
+ yy_destroy_ (YY_NULLPTR, yyla);
while (1 < yystack_.size ())
{
while (1 < yystack_.size ())
{
- yy_destroy_ (YY_NULL, yystack_[0]);
+ yy_destroy_ (YY_NULLPTR, yystack_[0]);
- char const* yyformat = YY_NULL;
+ char const* yyformat = YY_NULLPTR;
switch (yycount)
{
#define YYCASE_(N, S) \
switch (yycount)
{
#define YYCASE_(N, S) \
{
public:]m4_ifdef([b4_location_constructors], [[
/// Construct a position.
{
public:]m4_ifdef([b4_location_constructors], [[
/// Construct a position.
- explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
+ explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
: filename (f)
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
: filename (f)
- void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
+ void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
- void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
+ void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
unsigned int l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u)
{
/// Empty construction.
variant ()]b4_parse_assert_if([
/// Empty construction.
variant ()]b4_parse_assert_if([
- : yytname_ (YY_NULL)])[
+ : yytname_ (YY_NULLPTR)])[
{}
/// Construct and fill.
{}
/// Construct and fill.
destroy ()
{
as<T> ().~T ();]b4_parse_assert_if([
destroy ()
{
as<T> ().~T ();]b4_parse_assert_if([
+ yytname_ = YY_NULLPTR;])[
]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,
YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken)
{
]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,
YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = YY_NULL;
+ const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
}
yyarg[yycount++] = yytname[yyx];
{
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
b4_function_define([[yyparse]], [[int]], b4_parse_param)[
{
b4_function_define([[yyparse]], [[int]], b4_parse_param)[
{
- return yypull_parse (YY_NULL]m4_ifset([b4_parse_param],
+ return yypull_parse (YY_NULLPTR]m4_ifset([b4_parse_param],
[[, ]b4_args(b4_parse_param)])[);
}
[[, ]b4_args(b4_parse_param)])[);
}
{
yypstate *yyps;]b4_pure_if([], [[
if (yypstate_allocated)
{
yypstate *yyps;]b4_pure_if([], [[
if (yypstate_allocated)
yyps = (yypstate *) malloc (sizeof *yyps);
if (!yyps)
yyps = (yypstate *) malloc (sizeof *yyps);
if (!yyps)
yyps->yynew = 1;]b4_pure_if([], [[
yypstate_allocated = 1;]])[
return yyps;
yyps->yynew = 1;]b4_pure_if([], [[
yypstate_allocated = 1;]])[
return yyps;
#line 82 "src/parse-gram.c" /* yacc.c:339 */
#line 82 "src/parse-gram.c" /* yacc.c:339 */
# if defined __cplusplus && 201103L <= __cplusplus
# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULL nullptr
+# define YY_NULLPTR nullptr
"symbols.1", "generic_symlist", "generic_symlist_item", "tag",
"symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration",
"rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable", "value",
"symbols.1", "generic_symlist", "generic_symlist_item", "tag",
"symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration",
"rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable", "value",
- "id", "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULL
+ "id", "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULLPTR
yytype_int16 *yyesa, yytype_int16 **yyes,
YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken)
{
yytype_int16 *yyesa, yytype_int16 **yyes,
YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = YY_NULL;
+ const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
}
yyarg[yycount++] = yytname[yyx];
{
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
;
%%
/* Alias to ARGV[1]. */
;
%%
/* Alias to ARGV[1]. */
-const char *source = YY_NULL;
+const char *source = YY_NULLPTR;
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE($][1); $][$ = $][2; }
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE($][1); $][$ = $][2; }
-| 'R' { ]AT_VARIANT_IF([], [$][$ = YY_NULL; delete $][1]; )[YYERROR; }
+| 'R' { ]AT_VARIANT_IF([], [$][$ = YY_NULLPTR; delete $][1]; )[YYERROR; }
| 'p' { $][$ = $][1; }
| 's' { $][$ = $][1; throw std::runtime_error ("reduction"); }
| 'p' { $][$ = $][1; }
| 's' { $][$ = $][1; throw std::runtime_error ("reduction"); }
-| 'T' { ]AT_VARIANT_IF([], [$][$ = YY_NULL; delete $][1]; )[YYABORT; }
-| error { ]AT_VARIANT_IF([], [$][$ = YY_NULL; ])[yyerrok; }
+| 'T' { ]AT_VARIANT_IF([], [$][$ = YY_NULLPTR; delete $][1]; )[YYABORT; }
+| error { ]AT_VARIANT_IF([], [$][$ = YY_NULLPTR; ])[yyerrok; }
{
std::cerr << "unknown exception caught" << std::endl;
}
{
std::cerr << "unknown exception caught" << std::endl;
}
- Object::log (YY_NULL, "end");
+ Object::log (YY_NULLPTR, "end");
assert (Object::empty());
return res;
}
assert (Object::empty());
return res;
}
stmt : expr ';' $2 { $$ = ]$[1; }
| decl $3
stmt : expr ';' $2 { $$ = ]$[1; }
| decl $3
- | error ';' { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); }
+ | error ';' { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
| '@' { YYACCEPT; }
;
expr : ID
| TYPENAME '(' expr ')'
| '@' { YYACCEPT; }
;
expr : ID
| TYPENAME '(' expr ')'
- { $$ = new_nterm ("<cast>(%s,%s)", ]$[3, ]$[1, YY_NULL); }
- | expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, YY_NULL); }
- | expr '=' expr { $$ = new_nterm ("=(%s,%s)", ]$[1, ]$[3, YY_NULL); }
+ { $$ = new_nterm ("<cast>(%s,%s)", ]$[3, ]$[1, YY_NULLPTR); }
+ | expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, YY_NULLPTR); }
+ | expr '=' expr { $$ = new_nterm ("=(%s,%s)", ]$[1, ]$[3, YY_NULLPTR); }
;
decl : TYPENAME declarator ';'
;
decl : TYPENAME declarator ';'
- { $$ = new_nterm ("<declare>(%s,%s)", ]$[1, ]$[2, YY_NULL); }
+ { $$ = new_nterm ("<declare>(%s,%s)", ]$[1, ]$[2, YY_NULLPTR); }
| TYPENAME declarator '=' expr ';'
{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", ]$[1,
]$[2, ]$[4); }
| TYPENAME declarator '=' expr ';'
{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", ]$[1,
]$[2, ]$[4); }
}]AT_LOCATION_IF([[
yylloc.last_column = colNum-1;]])[
return tok;
}]AT_LOCATION_IF([[
yylloc.last_column = colNum-1;]])[
return tok;
[[static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
[[static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
- return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULL);
+ return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULLPTR);
-const char *input = YY_NULL;
+const char *input = YY_NULLPTR;
int
main (int argc, const char* argv[])
int
main (int argc, const char* argv[])
+FILE *input = YY_NULLPTR;
int P[] = { P1, P2 };
int O[] = { O1, O2 };
int P[] = { P1, P2 };
int O[] = { O1, O2 };
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|YY_INITIAL_VALUE
|YY_\w+_INCLUDED
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|YY_INITIAL_VALUE
|YY_\w+_INCLUDED
|(defined|if)\ YYDEBUG
)\b}{}gx;
while (/^(.*YY.*)$/gm)
|(defined|if)\ YYDEBUG
)\b}{}gx;
while (/^(.*YY.*)$/gm)
/* yypstate_delete used to leak ps->yyss if the stack was reallocated but the
parse did not return on success, syntax error, or memory exhaustion. */
ps = yypstate_new ();
/* yypstate_delete used to leak ps->yyss if the stack was reallocated but the
parse did not return on success, syntax error, or memory exhaustion. */
ps = yypstate_new ();
- assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE);
+ assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE);
yypstate_delete (ps);
ps = yypstate_new ();
yypstate_delete (ps);
ps = yypstate_new ();
- assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE);
- assert (yypush_parse (ps, 'b', YY_NULL) == YYPUSH_MORE);
+ assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE);
+ assert (yypush_parse (ps, 'b', YY_NULLPTR) == YYPUSH_MORE);
yypstate_delete (ps);
return 0;
yypstate_delete (ps);
return 0;
{
yypstate *ps = yypstate_new ();
assert (ps);
{
yypstate *ps = yypstate_new ();
assert (ps);
- assert (yypstate_new () == YY_NULL);
+ assert (yypstate_new () == YY_NULLPTR);
]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[;
yychar = 0;
assert (yypush_parse (ps) == 0);
]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[;
yychar = 0;
assert (yypush_parse (ps) == 0);
- assert (yypstate_new () == YY_NULL);
+ assert (yypstate_new () == YY_NULLPTR);
]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[;
yypstate_delete (ps);
}
]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[;
yypstate_delete (ps);
}
static const char *const yytname[] =
{
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
static const char *const yytname[] =
{
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
- "\"else\"", "$accept", "statement", "struct_stat", "if", "else", YY_NULL
+ "\"else\"", "$accept", "statement", "struct_stat", "if", "else", YY_NULLPTR
};
static const yytype_uint16 yytoknum[] =
{
};
static const yytype_uint16 yytoknum[] =
{