parsers: rename YY_NULL as YY_NULLPTR to avoid conflicts with Flex

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.
This commit is contained in:
Akim Demaille
2013-11-08 10:52:15 +01:00
parent afc4457605
commit 8d0b7cef7d
14 changed files with 105 additions and 105 deletions

View File

@@ -269,14 +269,14 @@ m4_define([b4_attribute_define],
# 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). # language (C, C++98, or C++11).
m4_define([b4_null_define], m4_define([b4_null_define],
[# ifndef YY_NULL [# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus # if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULL nullptr # define YY_NULLPTR nullptr
# else # else
# define YY_NULL 0 # define YY_NULLPTR 0
# endif # endif
# endif[]dnl # endif[]dnl
]) ])
@@ -285,7 +285,7 @@ m4_define([b4_null_define],
# b4_null # b4_null
# ------- # -------
# Return a null pointer constant. # 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)
# ------------------------------------------------------------- # -------------------------------------------------------------

View File

@@ -672,7 +672,7 @@ static void yyexpandGLRStack (yyGLRStack* yystackp);
static _Noreturn void static _Noreturn void
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg) yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
{ {
if (yymsg != YY_NULL) if (yymsg != YY_NULLPTR)
yyerror (]b4_yyerror_args[yymsg); yyerror (]b4_yyerror_args[yymsg);
YYLONGJMP (yystackp->yyexception_buffer, 1); YYLONGJMP (yystackp->yyexception_buffer, 1);
} }
@@ -715,7 +715,7 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
else else
/* The effect of using yysval or yyloc (in an immediate rule) is /* The effect of using yysval or yyloc (in an immediate rule) is
* undefined. */ * 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;]])[ yyvsp[i].yystate.yyloc = s->yyloc;]])[
s = yyvsp[i].yystate.yypred = s->yypred; s = yyvsp[i].yystate.yypred = s->yypred;
} }
@@ -747,7 +747,7 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp,
yyGLRStack* yystackp, yyGLRStack* yystackp,
YYSTYPE* yyvalp]b4_locuser_formals[) 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; int yylow;
]b4_parse_param_use([yyvalp], [yylocp])dnl ]b4_parse_param_use([yyvalp], [yylocp])dnl
[ YYUSE (yyrhslen); [ YYUSE (yyrhslen);
@@ -834,7 +834,7 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
YYFPRINTF (stderr, "%s unresolved", yymsg); YYFPRINTF (stderr, "%s unresolved", yymsg);
else else
YYFPRINTF (stderr, "%s incomplete", yymsg); 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);
} }
#endif #endif
@@ -987,7 +987,7 @@ yyinitStateSet (yyGLRStateSet* yyset)
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]); yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
if (! yyset->yystates) if (! yyset->yystates)
return yyfalse; return yyfalse;
yyset->yystates[0] = YY_NULL; yyset->yystates[0] = YY_NULLPTR;
yyset->yylookaheadNeeds = yyset->yylookaheadNeeds =
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]); (yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
if (! yyset->yylookaheadNeeds) if (! yyset->yylookaheadNeeds)
@@ -1017,8 +1017,8 @@ yyinitGLRStack (yyGLRStack* yystackp, size_t yysize)
if (!yystackp->yyitems) if (!yystackp->yyitems)
return yyfalse; return yyfalse;
yystackp->yynextFree = yystackp->yyitems; yystackp->yynextFree = yystackp->yyitems;
yystackp->yysplitPoint = YY_NULL; yystackp->yysplitPoint = YY_NULLPTR;
yystackp->yylastDeleted = YY_NULL; yystackp->yylastDeleted = YY_NULLPTR;
return yyinitStateSet (&yystackp->yytops); return yyinitStateSet (&yystackp->yytops);
} }
@@ -1057,10 +1057,10 @@ yyexpandGLRStack (yyGLRStack* yystackp)
{ {
yyGLRState* yys0 = &yyp0->yystate; yyGLRState* yys0 = &yyp0->yystate;
yyGLRState* yys1 = &yyp1->yystate; yyGLRState* yys1 = &yyp1->yystate;
if (yys0->yypred != YY_NULL) if (yys0->yypred != YY_NULLPTR)
yys1->yypred = yys1->yypred =
YYRELOC (yyp0, yyp1, yys0->yypred, yystate); 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 = yys1->yysemantics.yyfirstVal =
YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption); YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
} }
@@ -1068,18 +1068,18 @@ yyexpandGLRStack (yyGLRStack* yystackp)
{ {
yySemanticOption* yyv0 = &yyp0->yyoption; yySemanticOption* yyv0 = &yyp0->yyoption;
yySemanticOption* yyv1 = &yyp1->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 = YYRELOC (yystackp->yyitems, yynewItems,
yystackp->yysplitPoint, yystate); yystackp->yysplitPoint, yystate);
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1) 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] = yystackp->yytops.yystates[yyn] =
YYRELOC (yystackp->yyitems, yynewItems, YYRELOC (yystackp->yyitems, yynewItems,
yystackp->yytops.yystates[yyn], yystate); yystackp->yytops.yystates[yyn], yystate);
@@ -1103,7 +1103,7 @@ yyfreeGLRStack (yyGLRStack* yystackp)
static inline void static inline void
yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys) 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;
} }
@@ -1111,9 +1111,9 @@ yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
static inline void static inline void
yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk) 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
@@ -1122,12 +1122,12 @@ yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
static void static void
yyundeleteLastStack (yyGLRStack* yystackp) yyundeleteLastStack (yyGLRStack* yystackp)
{ {
if (yystackp->yylastDeleted == YY_NULL || yystackp->yytops.yysize != 0) if (yystackp->yylastDeleted == YY_NULLPTR || yystackp->yytops.yysize != 0)
return; return;
yystackp->yytops.yystates[0] = yystackp->yylastDeleted; yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
yystackp->yytops.yysize = 1; yystackp->yytops.yysize = 1;
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n")); YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
yystackp->yylastDeleted = YY_NULL; yystackp->yylastDeleted = YY_NULLPTR;
} }
static inline void static inline void
@@ -1137,7 +1137,7 @@ yyremoveDeletes (yyGLRStack* yystackp)
yyi = yyj = 0; yyi = yyj = 0;
while (yyj < yystackp->yytops.yysize) while (yyj < yystackp->yytops.yysize)
{ {
if (yystackp->yytops.yystates[yyi] == YY_NULL) if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
{ {
if (yyi == yyj) if (yyi == yyj)
{ {
@@ -1201,7 +1201,7 @@ yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
yynewState->yyposn = yyposn; yynewState->yyposn = yyposn;
yynewState->yyresolved = yyfalse; yynewState->yyresolved = yyfalse;
yynewState->yypred = yystackp->yytops.yystates[yyk]; yynewState->yypred = yystackp->yytops.yystates[yyk];
yynewState->yysemantics.yyfirstVal = YY_NULL; yynewState->yysemantics.yyfirstVal = YY_NULLPTR;
yystackp->yytops.yystates[yyk] = yynewState; yystackp->yytops.yystates[yyk] = yynewState;
/* Invokes YY_RESERVE_GLRSTACK. */ /* Invokes YY_RESERVE_GLRSTACK. */
@@ -1261,7 +1261,7 @@ yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
{ {
int yynrhs = yyrhsLength (yyrule); int yynrhs = yyrhsLength (yyrule);
if (yystackp->yysplitPoint == YY_NULL) if (yystackp->yysplitPoint == YY_NULLPTR)
{ {
/* Standard special case: single stack. */ /* Standard special case: single stack. */
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk]; yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
@@ -1313,13 +1313,13 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
{ {
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([[ YYSTYPE yysval;]b4_locations_if([[
YYLTYPE yyloc;]])[ YYLTYPE yyloc;]])[
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&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", YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
(unsigned long int) yyk, yyrule - 1)); (unsigned long int) yyk, yyrule - 1));
@@ -1352,7 +1352,7 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
"Now in state %d.\n", "Now in state %d.\n",
(unsigned long int) yyk, yyrule - 1, yynewLRState)); (unsigned long int) yyk, yyrule - 1, yynewLRState));
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1) 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 *yysplit = yystackp->yysplitPoint;
yyGLRState *yyp = yystackp->yytops.yystates[yyi]; yyGLRState *yyp = yystackp->yytops.yystates[yyi];
@@ -1379,7 +1379,7 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
static size_t static size_t
yysplitStack (yyGLRStack* yystackp, size_t yyk) yysplitStack (yyGLRStack* yystackp, size_t yyk)
{ {
if (yystackp->yysplitPoint == YY_NULL) if (yystackp->yysplitPoint == YY_NULLPTR)
{ {
YYASSERT (yyk == 0); YYASSERT (yyk == 0);
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk]; yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
@@ -1389,7 +1389,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
yyGLRState** yynewStates; yyGLRState** yynewStates;
yybool* yynewLookaheadNeeds; yybool* yynewLookaheadNeeds;
yynewStates = YY_NULL; yynewStates = YY_NULLPTR;
if (yystackp->yytops.yycapacity if (yystackp->yytops.yycapacity
> (YYSIZEMAX / (2 * sizeof yynewStates[0]))) > (YYSIZEMAX / (2 * sizeof yynewStates[0])))
@@ -1400,7 +1400,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates, (yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
(yystackp->yytops.yycapacity (yystackp->yytops.yycapacity
* sizeof yynewStates[0])); * sizeof yynewStates[0]));
if (yynewStates == YY_NULL) if (yynewStates == YY_NULLPTR)
yyMemoryExhausted (yystackp); yyMemoryExhausted (yystackp);
yystackp->yytops.yystates = yynewStates; yystackp->yytops.yystates = yynewStates;
@@ -1408,7 +1408,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
(yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds, (yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
(yystackp->yytops.yycapacity (yystackp->yytops.yycapacity
* sizeof yynewLookaheadNeeds[0])); * sizeof yynewLookaheadNeeds[0]));
if (yynewLookaheadNeeds == YY_NULL) if (yynewLookaheadNeeds == YY_NULLPTR)
yyMemoryExhausted (yystackp); yyMemoryExhausted (yystackp);
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds; yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
} }
@@ -1472,9 +1472,9 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal; yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
while (yytrue) while (yytrue)
{ {
if (yyz1 == *yyz0p || yyz1 == YY_NULL) if (yyz1 == *yyz0p || yyz1 == YY_NULLPTR)
break; break;
else if (*yyz0p == YY_NULL) else if (*yyz0p == YY_NULLPTR)
{ {
*yyz0p = yyz1; *yyz0p = yyz1;
break; break;
@@ -1595,7 +1595,7 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred) for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
yystates[yyi] = yys; yystates[yyi] = yys;
if (yys == YY_NULL) if (yys == YY_NULLPTR)
{ {
yyleftmost_state.yyposn = 0; yyleftmost_state.yyposn = 0;
yystates[0] = &yyleftmost_state; yystates[0] = &yyleftmost_state;
@@ -1666,7 +1666,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
yyGLRStackItem yyrhsloc[1 + YYMAXRHS]; yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
int yynrhs; int yynrhs;
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal; yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
YYASSERT (yyoption != YY_NULL); YYASSERT (yyoption != YY_NULLPTR);
yynrhs = yyrhsLength (yyoption->yyrule); yynrhs = yyrhsLength (yyoption->yyrule);
if (yynrhs > 0) if (yynrhs > 0)
{ {
@@ -1725,7 +1725,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
YYRESULTTAG yyflag;]b4_locations_if([ YYRESULTTAG yyflag;]b4_locations_if([
YYLTYPE *yylocp = &yys->yyloc;])[ YYLTYPE *yylocp = &yys->yyloc;])[
for (yypp = &yyoptionList->yynext; *yypp != YY_NULL; ) for (yypp = &yyoptionList->yynext; *yypp != YY_NULLPTR; )
{ {
yySemanticOption* yyp = *yypp; yySemanticOption* yyp = *yypp;
@@ -1767,7 +1767,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
int yyprec = yydprec[yybest->yyrule]; int yyprec = yydprec[yybest->yyrule];
yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[); yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[);
if (yyflag == yyok) 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])
{ {
@@ -1794,14 +1794,14 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
yys->yysemantics.yysval = yysval; yys->yysemantics.yysval = yysval;
} }
else else
yys->yysemantics.yyfirstVal = YY_NULL; yys->yysemantics.yyfirstVal = YY_NULLPTR;
return yyflag; return yyflag;
} }
static YYRESULTTAG static YYRESULTTAG
yyresolveStack (yyGLRStack* yystackp]b4_user_formals[) yyresolveStack (yyGLRStack* yystackp]b4_user_formals[)
{ {
if (yystackp->yysplitPoint != YY_NULL) if (yystackp->yysplitPoint != YY_NULLPTR)
{ {
yyGLRState* yys; yyGLRState* yys;
int yyn; int yyn;
@@ -1821,10 +1821,10 @@ yycompressStack (yyGLRStack* yystackp)
{ {
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)
return; return;
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; yyp != yystackp->yysplitPoint;
yyr = yyp, yyp = yyq, yyq = yyp->yypred) yyr = yyp, yyp = yyq, yyq = yyp->yypred)
yyp->yypred = yyr; yyp->yypred = yyr;
@@ -1832,10 +1832,10 @@ yycompressStack (yyGLRStack* yystackp)
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems; yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1; yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems; yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
yystackp->yysplitPoint = YY_NULL; yystackp->yysplitPoint = YY_NULLPTR;
yystackp->yylastDeleted = YY_NULL; yystackp->yylastDeleted = YY_NULLPTR;
while (yyr != YY_NULL) while (yyr != YY_NULLPTR)
{ {
yystackp->yynextFree->yystate = *yyr; yystackp->yynextFree->yystate = *yyr;
yyr = yyr->yypred; yyr = yyr->yypred;
@@ -1850,7 +1850,7 @@ static YYRESULTTAG
yyprocessOneStack (yyGLRStack* yystackp, size_t yyk, yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
size_t yyposn]b4_pure_formals[) 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; yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
YYDPRINTF ((stderr, "Stack %lu Entering state %d\n", YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
@@ -1972,13 +1972,13 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
#else #else
{ {
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 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; size_t yysize = yysize0;
yybool yysize_overflow = yyfalse; yybool yysize_overflow = yyfalse;
char* yymsg = YY_NULL; char* yymsg = YY_NULLPTR;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */ /* Internationalized format string. */
const char *yyformat = YY_NULL; const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */ /* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per /* Number of reported tokens (one for the "unexpected", one per
@@ -2034,7 +2034,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
} }
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_overflow |= yysz < yysize;
yysize = yysz; yysize = yysz;
} }
@@ -2112,7 +2112,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
{ {
yySymbol yytoken; yySymbol yytoken;
if (yychar == YYEOF) if (yychar == YYEOF)
yyFail (yystackp][]b4_lpure_args[, YY_NULL); yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
if (yychar != YYEMPTY) if (yychar != YYEMPTY)
{]b4_locations_if([[ {]b4_locations_if([[
/* We throw away the lookahead, but the error range /* We throw away the lookahead, but the error range
@@ -2153,10 +2153,10 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
/* Reduce to one stack. */ /* Reduce to one stack. */
for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1) for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
if (yystackp->yytops.yystates[yyk] != YY_NULL) if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
break; break;
if (yyk >= yystackp->yytops.yysize) 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) for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
yymarkStackDeleted (yystackp, yyk); yymarkStackDeleted (yystackp, yyk);
yyremoveDeletes (yystackp); yyremoveDeletes (yystackp);
@@ -2164,7 +2164,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
/* Now pop stack until we find a state that shifts the error token. */ /* Now pop stack until we find a state that shifts the error token. */
yystackp->yyerrState = 3; yystackp->yyerrState = 3;
while (yystackp->yytops.yystates[0] != YY_NULL) while (yystackp->yytops.yystates[0] != YY_NULLPTR)
{ {
yyGLRState *yys = yystackp->yytops.yystates[0]; yyGLRState *yys = yystackp->yytops.yystates[0];
yyj = yypact[yys->yylrState]; yyj = yypact[yys->yylrState];
@@ -2188,14 +2188,14 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
} }
}]b4_locations_if([[ }]b4_locations_if([[
yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[ 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[); yydestroyGLRState ("Error: popping", yys]b4_user_args[);
yystackp->yytops.yystates[0] = yys->yypred; yystackp->yytops.yystates[0] = yys->yypred;
yystackp->yynextFree -= 1; yystackp->yynextFree -= 1;
yystackp->yyspaceLeft += 1; yystackp->yyspaceLeft += 1;
} }
if (yystackp->yytops.yystates[0] == YY_NULL) if (yystackp->yytops.yystates[0] == YY_NULLPTR)
yyFail (yystackp][]b4_lpure_args[, YY_NULL); yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
} }
#define YYCHK1(YYE) \ #define YYCHK1(YYE) \
@@ -2438,7 +2438,7 @@ b4_dollar_popdef])[]dnl
{ {
yyGLRState *yys = yystates[yyk]; yyGLRState *yys = yystates[yyk];
]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]] ]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[); yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[);
yystates[yyk] = yys->yypred; yystates[yyk] = yys->yypred;
yystack.yynextFree -= 1; yystack.yynextFree -= 1;
@@ -2470,7 +2470,7 @@ yy_yypstack (yyGLRState* yys)
static void static void
yypstates (yyGLRState* yyst) yypstates (yyGLRState* yyst)
{ {
if (yyst == YY_NULL) if (yyst == YY_NULLPTR)
YYFPRINTF (stderr, "<null>"); YYFPRINTF (stderr, "<null>");
else else
yy_yypstack (yyst); yy_yypstack (yyst);
@@ -2484,7 +2484,7 @@ yypstack (yyGLRStack* yystackp, size_t yyk)
} }
#define YYINDEX(YYX) \ #define YYINDEX(YYX) \
((YYX) == YY_NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems) ((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
static void static void

View File

@@ -735,7 +735,7 @@ b4_dollar_popdef])[]dnl
location values to have been already stored, initialize these location values to have been already stored, initialize these
stacks with a primary value. */ stacks with a primary value. */
yystack_.clear (); yystack_.clear ();
yypush_ (YY_NULL, 0, yyla); yypush_ (YY_NULLPTR, 0, yyla);
// A new symbol was pushed on the stack. // A new symbol was pushed on the stack.
yynewstate: yynewstate:
@@ -860,7 +860,7 @@ b4_dollar_popdef])[]dnl
YY_STACK_PRINT (); YY_STACK_PRINT ();
// Shift the result of the reduction. // Shift the result of the reduction.
yypush_ (YY_NULL, yylhs); yypush_ (YY_NULLPTR, yylhs);
goto yynewstate; goto yynewstate;
/*--------------------------------------. /*--------------------------------------.
@@ -989,11 +989,11 @@ b4_dollar_popdef])[]dnl
// Do not try to display the values of the reclaimed symbols, // Do not try to display the values of the reclaimed symbols,
// as their printer might throw an exception. // as their printer might throw an exception.
if (!yyempty) 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]);
yypop_ (); yypop_ ();
} }
throw; throw;
@@ -1075,7 +1075,7 @@ b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
} }
} }
char const* yyformat = YY_NULL; char const* yyformat = YY_NULLPTR;
switch (yycount) switch (yycount)
{ {
#define YYCASE_(N, S) \ #define YYCASE_(N, S) \

View File

@@ -27,7 +27,7 @@ m4_define([b4_position_define],
{ {
public:]m4_ifdef([b4_location_constructors], [[ public:]m4_ifdef([b4_location_constructors], [[
/// Construct a position. /// 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 l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u) unsigned int c = ]b4_location_initial_column[u)
: filename (f) : filename (f)
@@ -38,7 +38,7 @@ m4_define([b4_position_define],
]])[ ]])[
/// Initialization. /// Initialization.
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 l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u) unsigned int c = ]b4_location_initial_column[u)
{ {
@@ -178,7 +178,7 @@ m4_define([b4_location_define],
])[ ])[
/// Initialization. /// Initialization.
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 l = ]b4_location_initial_line[u,
unsigned int c = ]b4_location_initial_column[u) unsigned int c = ]b4_location_initial_column[u)
{ {

View File

@@ -95,7 +95,7 @@ m4_define([b4_variant_define],
/// Empty construction. /// Empty construction.
variant ()]b4_parse_assert_if([ variant ()]b4_parse_assert_if([
: yytname_ (YY_NULL)])[ : yytname_ (YY_NULLPTR)])[
{} {}
/// Construct and fill. /// Construct and fill.
@@ -198,7 +198,7 @@ m4_define([b4_variant_define],
destroy () destroy ()
{ {
as<T> ().~T ();]b4_parse_assert_if([ as<T> ().~T ();]b4_parse_assert_if([
yytname_ = YY_NULL;])[ yytname_ = YY_NULLPTR;])[
} }
private: private:

View File

@@ -1108,11 +1108,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes, ]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,
YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken) 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; YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */ /* Internationalized format string. */
const char *yyformat = YY_NULL; const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */ /* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per /* Number of reported tokens (one for the "unexpected", one per
@@ -1187,7 +1187,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
} }
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 if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM)) && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2; return 2;
@@ -1271,7 +1271,7 @@ static char yypstate_allocated = 0;]])b4_pull_if([
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)])[);
} }
@@ -1313,10 +1313,10 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
{ {
yypstate *yyps;]b4_pure_if([], [[ yypstate *yyps;]b4_pure_if([], [[
if (yypstate_allocated) if (yypstate_allocated)
return YY_NULL;]])[ return YY_NULLPTR;]])[
yyps = (yypstate *) malloc (sizeof *yyps); yyps = (yypstate *) malloc (sizeof *yyps);
if (!yyps) if (!yyps)
return YY_NULL; return YY_NULLPTR;
yyps->yynew = 1;]b4_pure_if([], [[ yyps->yynew = 1;]b4_pure_if([], [[
yypstate_allocated = 1;]])[ yypstate_allocated = 1;]])[
return yyps; return yyps;

View File

@@ -80,11 +80,11 @@
#line 82 "src/parse-gram.c" /* yacc.c:339 */ #line 82 "src/parse-gram.c" /* yacc.c:339 */
# ifndef YY_NULL # ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus # if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULL nullptr # define YY_NULLPTR nullptr
# else # else
# define YY_NULL 0 # define YY_NULLPTR 0
# endif # endif
# endif # endif
@@ -639,7 +639,7 @@ static const char *const yytname[] =
"symbols.1", "generic_symlist", "generic_symlist_item", "tag", "symbols.1", "generic_symlist", "generic_symlist_item", "tag",
"symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration",
"rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable", "value", "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
}; };
#endif #endif
@@ -1569,11 +1569,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyesa, yytype_int16 **yyes, yytype_int16 *yyesa, yytype_int16 **yyes,
YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken) 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; YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */ /* Internationalized format string. */
const char *yyformat = YY_NULL; const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */ /* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per /* Number of reported tokens (one for the "unexpected", one per
@@ -1628,7 +1628,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
} }
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 if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM)) && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2; return 2;

View File

@@ -596,7 +596,7 @@ thing:
; ;
%% %%
/* Alias to ARGV[1]. */ /* Alias to ARGV[1]. */
const char *source = YY_NULL; const char *source = YY_NULLPTR;
]AT_YYERROR_DEFINE[ ]AT_YYERROR_DEFINE[

View File

@@ -796,11 +796,11 @@ item:
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and // Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test. // then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE($][1); $][$ = $][2; } | '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; } | 'p' { $][$ = $][1; }
| 's' { $][$ = $][1; throw std::runtime_error ("reduction"); } | 's' { $][$ = $][1; throw std::runtime_error ("reduction"); }
| 'T' { ]AT_VARIANT_IF([], [$][$ = YY_NULL; delete $][1]; )[YYABORT; } | 'T' { ]AT_VARIANT_IF([], [$][$ = YY_NULLPTR; delete $][1]; )[YYABORT; }
| error { ]AT_VARIANT_IF([], [$][$ = YY_NULL; ])[yyerrok; } | error { ]AT_VARIANT_IF([], [$][$ = YY_NULLPTR; ])[yyerrok; }
; ;
%% %%
@@ -868,7 +868,7 @@ main (int argc, const char *argv[])
{ {
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()); assert (Object::empty());
return res; return res;
} }

View File

@@ -94,19 +94,19 @@ prog :
stmt : expr ';' $2 { $$ = ]$[1; } stmt : expr ';' $2 { $$ = ]$[1; }
| decl $3 | decl $3
| error ';' { $$ = new_nterm ("<error>", YY_NULL, YY_NULL, YY_NULL); } | error ';' { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
| '@' { YYACCEPT; } | '@' { YYACCEPT; }
; ;
expr : ID expr : ID
| TYPENAME '(' expr ')' | TYPENAME '(' expr ')'
{ $$ = new_nterm ("<cast>(%s,%s)", ]$[3, ]$[1, YY_NULL); } { $$ = new_nterm ("<cast>(%s,%s)", ]$[3, ]$[1, YY_NULLPTR); }
| expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, YY_NULL); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, YY_NULLPTR); }
| expr '=' expr { $$ = new_nterm ("=(%s,%s)", ]$[1, ]$[3, YY_NULL); } | 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 ';' | TYPENAME declarator '=' expr ';'
{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", ]$[1, { $$ = new_nterm ("<init-declare>(%s,%s,%s)", ]$[1,
]$[2, ]$[4); } ]$[2, ]$[4); }
@@ -195,7 +195,7 @@ main (int argc, char **argv)
{ {
colNum += 1; colNum += 1;
tok = c; tok = c;
yylval = YY_NULL; yylval = YY_NULLPTR;
}]AT_LOCATION_IF([[ }]AT_LOCATION_IF([[
yylloc.last_column = colNum-1;]])[ yylloc.last_column = colNum-1;]])[
return tok; return tok;
@@ -287,7 +287,7 @@ m4_bmatch([$2], [stmtMerge],
[[static YYSTYPE [[static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1) 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);
} }
]]) ]])
) )

View File

@@ -67,7 +67,7 @@ static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
return 0; return 0;
} }
const char *input = YY_NULL; const char *input = YY_NULLPTR;
int int
main (int argc, const char* argv[]) main (int argc, const char* argv[])
@@ -304,7 +304,7 @@ MergeRule (int x0, int x1)
} }
]AT_YYERROR_DEFINE[ ]AT_YYERROR_DEFINE[
FILE *input = YY_NULL; FILE *input = YY_NULLPTR;
int P[] = { P1, P2 }; int P[] = { P1, P2 };
int O[] = { O1, O2 }; int O[] = { O1, O2 };

View File

@@ -229,7 +229,7 @@ AT_CHECK([[$PERL -n -0777 -e '
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END) |YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|YY_INITIAL_VALUE |YY_INITIAL_VALUE
|YY_\w+_INCLUDED |YY_\w+_INCLUDED
|YY_NULL |YY_NULLPTR
|(defined|if)\ YYDEBUG |(defined|if)\ YYDEBUG
)\b}{}gx; )\b}{}gx;
while (/^(.*YY.*)$/gm) while (/^(.*YY.*)$/gm)

View File

@@ -57,12 +57,12 @@ main (void)
/* yypstate_delete used to leak ps->yyss if the stack was reallocated but the /* 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. */ parse did not return on success, syntax error, or memory exhaustion. */
ps = yypstate_new (); ps = yypstate_new ();
assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE); assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE);
yypstate_delete (ps); yypstate_delete (ps);
ps = yypstate_new (); ps = yypstate_new ();
assert (yypush_parse (ps, 'a', YY_NULL) == YYPUSH_MORE); assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE);
assert (yypush_parse (ps, 'b', YY_NULL) == YYPUSH_MORE); assert (yypush_parse (ps, 'b', YY_NULLPTR) == YYPUSH_MORE);
yypstate_delete (ps); yypstate_delete (ps);
return 0; return 0;
@@ -111,11 +111,11 @@ main (void)
{ {
yypstate *ps = yypstate_new (); yypstate *ps = yypstate_new ();
assert (ps); assert (ps);
assert (yypstate_new () == YY_NULL); assert (yypstate_new () == YY_NULLPTR);
]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[; ]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[;
yychar = 0; yychar = 0;
assert (yypush_parse (ps) == 0); assert (yypush_parse (ps) == 0);
assert (yypstate_new () == YY_NULL); assert (yypstate_new () == YY_NULLPTR);
]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[; ]m4_if([$1], [[both]], [[assert (yyparse () == 2)]])[;
yypstate_delete (ps); yypstate_delete (ps);
} }

View File

@@ -770,7 +770,7 @@ static const yytype_uint8 yyrline[] =
static const char *const yytname[] = static const char *const yytname[] =
{ {
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"", "$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[] =
{ {