mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
yysyntax_error: prepare for readability of next patches.
These are purely whitespace changes that result in ugly code but that make the next couple of patches much easier to read. * data/glr.c (yyreportSyntaxError): Reindent. * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent. * data/lalr1.java (YYParser::yysyntax_error): Reindent. * data/yacc.c (yysyntax_error): Reindent.
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2010-11-07 Joel E. Denny <jdenny@clemson.edu>
|
||||
|
||||
yysyntax_error: prepare for readability of next patches.
|
||||
These are purely whitespace changes that result in ugly code
|
||||
but that make the next couple of patches much easier to read.
|
||||
* data/glr.c (yyreportSyntaxError): Reindent.
|
||||
* data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
|
||||
* data/lalr1.java (YYParser::yysyntax_error): Reindent.
|
||||
* data/yacc.c (yysyntax_error): Reindent.
|
||||
|
||||
2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
|
||||
|
||||
Fix memory leak.
|
||||
|
||||
178
data/glr.c
178
data/glr.c
@@ -2081,104 +2081,104 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
#if YYERROR_VERBOSE
|
||||
int yyn;
|
||||
yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
if (YYPACT_NINF < yyn && yyn <= YYLAST)
|
||||
{
|
||||
yySymbol yytoken = YYTRANSLATE (yychar);
|
||||
size_t yysize0 = yytnamerr (NULL, yytokenName (yytoken));
|
||||
size_t yysize = yysize0;
|
||||
size_t yysize1;
|
||||
yybool yysize_overflow = yyfalse;
|
||||
char* yymsg = NULL;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = 0;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
if (YYPACT_NINF < yyn && yyn <= YYLAST)
|
||||
{
|
||||
yySymbol yytoken = YYTRANSLATE (yychar);
|
||||
size_t yysize0 = yytnamerr (NULL, yytokenName (yytoken));
|
||||
size_t yysize = yysize0;
|
||||
size_t yysize1;
|
||||
yybool yysize_overflow = yyfalse;
|
||||
char* yymsg = NULL;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = 0;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for this
|
||||
state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for this
|
||||
state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn + 1;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn + 1;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
int yycount = 0;
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
int yycount = 0;
|
||||
int yyx;
|
||||
|
||||
yyarg[yycount++] = yytokenName (yytoken);
|
||||
yyarg[yycount++] = yytokenName (yytoken);
|
||||
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
||||
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytokenName (yyx);
|
||||
yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
}
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
||||
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytokenName (yyx);
|
||||
yysize1 = yysize + yytnamerr (NULL, yytokenName (yyx));
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
}
|
||||
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
#undef YYCASE_
|
||||
}
|
||||
|
||||
yysize1 = yysize + strlen (yyformat);
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
|
||||
if (!yysize_overflow)
|
||||
yymsg = (char *) YYMALLOC (yysize);
|
||||
|
||||
if (yymsg)
|
||||
{
|
||||
char *yyp = yymsg;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyformat))
|
||||
{
|
||||
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyformat += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyformat++;
|
||||
}
|
||||
}
|
||||
yyerror (]b4_lyyerror_args[yymsg);
|
||||
YYFREE (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yyMemoryExhausted (yystackp);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yynerrs += 1;
|
||||
}
|
||||
|
||||
yysize1 = yysize + strlen (yyformat);
|
||||
yysize_overflow |= yysize1 < yysize;
|
||||
yysize = yysize1;
|
||||
|
||||
if (!yysize_overflow)
|
||||
yymsg = (char *) YYMALLOC (yysize);
|
||||
|
||||
if (yymsg)
|
||||
{
|
||||
char *yyp = yymsg;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyformat))
|
||||
{
|
||||
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyformat += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyformat++;
|
||||
}
|
||||
}
|
||||
yyerror (]b4_lyyerror_args[yymsg);
|
||||
YYFREE (yymsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yyMemoryExhausted (yystackp);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
yynerrs += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
|
||||
|
||||
@@ -982,62 +982,62 @@ b4_error_verbose_if([state_type yystate, int yytoken],
|
||||
int yyn = yypact_[yystate];
|
||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
||||
{
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for this
|
||||
state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for
|
||||
this state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
|
||||
// Number of reported tokens (one for the "unexpected", one per
|
||||
// "expected").
|
||||
size_t yycount = 0;
|
||||
size_t yycount = 0;
|
||||
// Its maximum.
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
// Arguments of yyformat.
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
yyarg[yycount++] = yytname_[yytoken];
|
||||
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
yyarg[yycount++] = yytname_[yyx];
|
||||
}
|
||||
for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
yyarg[yycount++] = yytname_[yyx];
|
||||
}
|
||||
|
||||
char const* yyformat = 0;
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
char const* yyformat = 0;
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
#undef YYCASE_
|
||||
}
|
||||
// Argument number.
|
||||
size_t yyi = 0;
|
||||
for (char const* yyp = yyformat; *yyp; ++yyp)
|
||||
if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyres += yytnamerr_ (yyarg[yyi++]);
|
||||
++yyp;
|
||||
}
|
||||
else
|
||||
yyres += *yyp;
|
||||
}
|
||||
else
|
||||
// Argument number.
|
||||
size_t yyi = 0;
|
||||
for (char const* yyp = yyformat; *yyp; ++yyp)
|
||||
if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyres += yytnamerr_ (yyarg[yyi++]);
|
||||
++yyp;
|
||||
}
|
||||
else
|
||||
yyres += *yyp;
|
||||
}
|
||||
else
|
||||
]])dnl
|
||||
[ yyres = YY_("syntax error");
|
||||
return yyres;
|
||||
|
||||
@@ -732,35 +732,36 @@ m4_popdef([b4_at_dollar])])dnl
|
||||
{
|
||||
StringBuffer res;
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for this
|
||||
state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
/* Start YYX at -YYN if negative to avoid negative
|
||||
indexes in YYCHECK. In other words, skip the first
|
||||
-YYN actions for this state because they are default
|
||||
actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
++count;
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = yylast_ - yyn + 1;
|
||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||
int count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
++count;
|
||||
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
res = new StringBuffer ("syntax error, unexpected ");
|
||||
res.append (yytnamerr_ (yytname_[tok]));
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
{
|
||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||
res.append (yytnamerr_ (yytname_[x]));
|
||||
}
|
||||
}
|
||||
if (count < 5)
|
||||
{
|
||||
count = 0;
|
||||
for (int x = yyxbegin; x < yyxend; ++x)
|
||||
if (yycheck_[x + yyn] == x && x != yyterror_
|
||||
&& !yy_table_value_is_error_ (yytable_[x + yyn]))
|
||||
{
|
||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||
res.append (yytnamerr_ (yytname_[x]));
|
||||
}
|
||||
}
|
||||
return res.toString ();
|
||||
}
|
||||
}
|
||||
|
||||
191
data/yacc.c
191
data/yacc.c
@@ -920,105 +920,104 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
|
||||
return 1;
|
||||
else
|
||||
{
|
||||
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
|
||||
YYSIZE_T yysize = yysize0;
|
||||
YYSIZE_T yysize1;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = 0;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for
|
||||
this state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn + 1;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
int yycount = 0;
|
||||
int yyx;
|
||||
|
||||
yyarg[yycount++] = yytname[yytoken];
|
||||
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
||||
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
{
|
||||
/* Overflow. */
|
||||
*yymsg_alloc = 0;
|
||||
return 2;
|
||||
}
|
||||
yysize = yysize1;
|
||||
}
|
||||
|
||||
switch (yycount)
|
||||
{
|
||||
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
|
||||
YYSIZE_T yysize = yysize0;
|
||||
YYSIZE_T yysize1;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = 0;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
|
||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||
YYCHECK. In other words, skip the first -YYN actions for this
|
||||
state because they are default actions. */
|
||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||
|
||||
/* Stay within bounds of both yycheck and yytname. */
|
||||
int yychecklim = YYLAST - yyn + 1;
|
||||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
"expected"). */
|
||||
int yycount = 0;
|
||||
int yyx;
|
||||
|
||||
yyarg[yycount++] = yytname[yytoken];
|
||||
|
||||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
||||
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
||||
{
|
||||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||||
{
|
||||
yycount = 1;
|
||||
yysize = yysize0;
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
if (! (yysize <= yysize1
|
||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
{
|
||||
/* Overflow. */
|
||||
*yymsg_alloc = 0;
|
||||
return 2;
|
||||
}
|
||||
yysize = yysize1;
|
||||
}
|
||||
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
#define YYCASE_(N, S) \
|
||||
case N: \
|
||||
yyformat = S; \
|
||||
break
|
||||
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
||||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
||||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
||||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
||||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
||||
#undef YYCASE_
|
||||
}
|
||||
|
||||
yysize1 = yysize + yystrlen (yyformat);
|
||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
{
|
||||
/* Overflow. */
|
||||
*yymsg_alloc = 0;
|
||||
return 2;
|
||||
}
|
||||
yysize = yysize1;
|
||||
|
||||
if (*yymsg_alloc < yysize)
|
||||
{
|
||||
*yymsg_alloc = 2 * yysize;
|
||||
if (! (yysize <= *yymsg_alloc
|
||||
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
|
||||
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Avoid sprintf, as that infringes on the user's name space.
|
||||
Don't have undefined behavior even if the translation
|
||||
produced a string with the wrong number of "%s"s. */
|
||||
{
|
||||
char *yyp = *yymsg;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyformat) != '\0')
|
||||
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyformat += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyformat++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
yysize1 = yysize + yystrlen (yyformat);
|
||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
{
|
||||
/* Overflow. */
|
||||
*yymsg_alloc = 0;
|
||||
return 2;
|
||||
}
|
||||
yysize = yysize1;
|
||||
|
||||
if (*yymsg_alloc < yysize)
|
||||
{
|
||||
*yymsg_alloc = 2 * yysize;
|
||||
if (! (yysize <= *yymsg_alloc
|
||||
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
|
||||
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Avoid sprintf, as that infringes on the user's name space.
|
||||
Don't have undefined behavior even if the translation
|
||||
produced a string with the wrong number of "%s"s. */
|
||||
{
|
||||
char *yyp = *yymsg;
|
||||
int yyi = 0;
|
||||
while ((*yyp = *yyformat) != '\0')
|
||||
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
||||
{
|
||||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||||
yyformat += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
yyp++;
|
||||
yyformat++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
|
||||
|
||||
791
src/parse-gram.c
791
src/parse-gram.c
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 2.4.533-95aed. */
|
||||
/* A Bison parser, made by GNU Bison 2.4.537-34db. */
|
||||
|
||||
/* Interface for Bison's Yacc-like parsers in C
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
/* "%code requires" blocks. */
|
||||
/* Line 1658 of yacc.c */
|
||||
/* Line 1663 of yacc.c */
|
||||
#line 202 "src/parse-gram.y"
|
||||
|
||||
# ifndef PARAM_TYPE
|
||||
@@ -46,7 +46,7 @@
|
||||
# endif
|
||||
|
||||
|
||||
/* Line 1658 of yacc.c */
|
||||
/* Line 1663 of yacc.c */
|
||||
#line 51 "src/parse-gram.h"
|
||||
|
||||
/* Tokens. */
|
||||
@@ -175,7 +175,7 @@
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 1658 of yacc.c */
|
||||
/* Line 1663 of yacc.c */
|
||||
#line 88 "src/parse-gram.y"
|
||||
|
||||
assoc assoc;
|
||||
@@ -188,13 +188,13 @@ typedef union YYSTYPE
|
||||
uniqstr uniqstr;
|
||||
unsigned char character;
|
||||
|
||||
/* Line 1658 of yacc.c */
|
||||
/* Line 1663 of yacc.c */
|
||||
#line 226 "src/parse-gram.y"
|
||||
|
||||
param_type param;
|
||||
|
||||
|
||||
/* Line 1658 of yacc.c */
|
||||
/* Line 1663 of yacc.c */
|
||||
#line 199 "src/parse-gram.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
||||
Reference in New Issue
Block a user