Merge remote-tracking branch 'origin/maint'

* origin/maint:
  glr: more assertions
  glr: shorten scopes
  glr: formatting changes
  glr: better use of tracing macros
  examples: improve the output of the "variant" example
  variant: remove useless assertion
  tests: remove stray debugging traces
  tests: do not use grep -q
  build: don't require flex for ordinary builds
  maint: update .gitignore
  build: port to pre-5.8.7 perl
  tests: minor change to make it easier to test other skeletons
  uniqstr: fix assertion
This commit is contained in:
Akim Demaille
2013-09-19 16:33:20 +02:00
12 changed files with 62 additions and 36 deletions

View File

@@ -836,12 +836,10 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
if (yydebug)
{
if (yys->yysemantics.yyfirstVal)
YYFPRINTF (stderr, "%s unresolved ", yymsg);
YYFPRINTF (stderr, "%s unresolved", yymsg);
else
YYFPRINTF (stderr, "%s incomplete ", yymsg);
yy_symbol_print (stderr, yystos[yys->yylrState],
YY_NULL]b4_locuser_args([&yys->yyloc])[);
YYFPRINTF (stderr, "\n");
YYFPRINTF (stderr, "%s incomplete", yymsg);
YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULL, &yys->yyloc);
}
#endif
@@ -966,6 +964,7 @@ yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
{
yySemanticOption* yynewOption =
&yynewGLRStackItem (yystackp, yyfalse)->yyoption;
YYASSERT (!yynewOption->yyisState);
yynewOption->yystate = yyrhs;
yynewOption->yyrule = yyrule;
if (yystackp->yytops.yylookaheadNeeds[yyk])
@@ -1082,7 +1081,7 @@ yyexpandGLRStack (yyGLRStack* yystackp)
}
if (yystackp->yysplitPoint != YY_NULL)
yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
yystackp->yysplitPoint, yystate);
yystackp->yysplitPoint, yystate);
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
if (yystackp->yytops.yystates[yyn] != YY_NULL)
@@ -1201,6 +1200,7 @@ yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
{
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
YYASSERT (yynewState->yyisState);
yynewState->yylrState = yylrState;
yynewState->yyposn = yyposn;
@@ -1320,11 +1320,10 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
if (yyforceEval || yystackp->yysplitPoint == YY_NULL)
{
YYRESULTTAG yyflag;
YYSTYPE yysval;]b4_locations_if([
YYLTYPE yyloc;])[
YYSTYPE yysval;]b4_locations_if([[
YYLTYPE yyloc;]])[
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)
{
YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
@@ -2493,6 +2492,8 @@ yypdumpstack (yyGLRStack* yystackp)
(unsigned long int) (yyp - yystackp->yyitems));
if (*(yybool *) yyp)
{
YYASSERT (yyp->yystate.yyisState);
YYASSERT (yyp->yyoption.yyisState);
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
yyp->yystate.yyresolved, yyp->yystate.yylrState,
(unsigned long int) yyp->yystate.yyposn,
@@ -2504,6 +2505,8 @@ yypdumpstack (yyGLRStack* yystackp)
}
else
{
YYASSERT (!yyp->yystate.yyisState);
YYASSERT (!yyp->yyoption.yyisState);
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
yyp->yyoption.yyrule - 1,
(long int) YYINDEX (yyp->yyoption.yystate),

View File

@@ -178,8 +178,7 @@ m4_define([b4_variant_define],
template <typename T>
void
move (self_type& other)
{]b4_parse_assert_if([
YYASSERT (!yytname_);])[
{
build<T> ();
swap<T> (other);
other.destroy<T> ();