mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
Work around a bug in bro 0.8, which underparenthesizes its
definition of YYLLOC_DEFAULT. * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize their arguments. * data/lalr1.cc: Likewise. * data/yacc.cc: Likewise.
This commit is contained in:
26
ChangeLog
26
ChangeLog
@@ -1,5 +1,31 @@
|
|||||||
|
2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
Work around a bug in bro 0.8, which underparenthesizes its
|
||||||
|
definition of YYLLOC_DEFAULT.
|
||||||
|
* data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
|
||||||
|
their arguments.
|
||||||
|
* data/lalr1.cc: Likewise.
|
||||||
|
* data/yacc.cc: Likewise.
|
||||||
|
|
||||||
2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
|
2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
Work around a bug in Pike 7.0, and give the Pike folks a
|
||||||
|
better way to override the usual int widths.
|
||||||
|
* data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
|
||||||
|
user can override the types.
|
||||||
|
(short): #undef, to work around a bug in Pike 7.0.
|
||||||
|
(yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
|
||||||
|
(union yyalloc.yyss): Use yytype_int16 rather than short.
|
||||||
|
All uses changed.
|
||||||
|
(yysigned_char): Remove.
|
||||||
|
* src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
|
||||||
|
(YYTYPE_INT16): New macros, to test the new facility in yacc.c.
|
||||||
|
* tests/regression.at (Web2c Actions): Adjust to above changes.
|
||||||
|
|
||||||
|
* src/reader.c (check_and_convert_grammar): New function.
|
||||||
|
(reader): Close the input file even if something went wrong during
|
||||||
|
parsing. Minor file descriptor leak reported by twlevo.
|
||||||
|
|
||||||
* src/assoc.c (assoc_to_string): Use a default: abort (); case
|
* src/assoc.c (assoc_to_string): Use a default: abort (); case
|
||||||
to pacify gcc -Wswitch-default.
|
to pacify gcc -Wswitch-default.
|
||||||
* src/scan-gram.l (adjust_location): Use a default: break; case
|
* src/scan-gram.l (adjust_location): Use a default: break; case
|
||||||
|
|||||||
@@ -923,7 +923,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
|
|||||||
*yyvalp = yyval_default;
|
*yyvalp = yyval_default;
|
||||||
else
|
else
|
||||||
*yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
|
*yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
|
||||||
YYLLOC_DEFAULT (*yylocp, yyvsp - yyrhslen, yyrhslen);
|
YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen);
|
||||||
]b4_location_if([[ yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
|
]b4_location_if([[ yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
|
||||||
]])[
|
]])[
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
@@ -2119,7 +2119,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
yyGLRStackItem yyerror_range[3];
|
yyGLRStackItem yyerror_range[3];
|
||||||
yyerror_range[1].yystate.yyloc = yys->yyloc;
|
yyerror_range[1].yystate.yyloc = yys->yyloc;
|
||||||
yyerror_range[2].yystate.yyloc = yylloc;
|
yyerror_range[2].yystate.yyloc = yylloc;
|
||||||
YYLLOC_DEFAULT (yys->yyloc, yyerror_range, 2);]])[
|
YYLLOC_DEFAULT ((yys->yyloc), yyerror_range, 2);]])[
|
||||||
yydestruct ("Error: discarding",
|
yydestruct ("Error: discarding",
|
||||||
*yytokenp, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
|
*yytokenp, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
|
||||||
}
|
}
|
||||||
@@ -2166,7 +2166,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
/* Shift the error token having adjusted its location. */
|
/* Shift the error token having adjusted its location. */
|
||||||
YYLTYPE yyerrloc;]b4_location_if([[
|
YYLTYPE yyerrloc;]b4_location_if([[
|
||||||
yystackp->yyerror_range[2].yystate.yyloc = yylloc;
|
yystackp->yyerror_range[2].yystate.yyloc = yylloc;
|
||||||
YYLLOC_DEFAULT (yyerrloc, yystackp->yyerror_range, 2);]])[
|
YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);]])[
|
||||||
YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
|
YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
|
||||||
&yylval, &yyerrloc);
|
&yylval, &yyerrloc);
|
||||||
yyglrShift (yystackp, 0, yytable[yyj],
|
yyglrShift (yystackp, 0, yytable[yyj],
|
||||||
|
|||||||
@@ -783,7 +783,7 @@ b4_error_verbose_if([, yytoken])[));
|
|||||||
yyerror_range[1] = yylloc;
|
yyerror_range[1] = yylloc;
|
||||||
// Using YYLLOC is tempting, but would change the location of
|
// Using YYLLOC is tempting, but would change the location of
|
||||||
// the look-ahead. YYLOC is available though.
|
// the look-ahead. YYLOC is available though.
|
||||||
YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
|
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
||||||
yysemantic_stack_.push (yylval);
|
yysemantic_stack_.push (yylval);
|
||||||
yylocation_stack_.push (yyloc);
|
yylocation_stack_.push (yyloc);
|
||||||
|
|
||||||
|
|||||||
@@ -1262,7 +1262,7 @@ yyreduce:
|
|||||||
|
|
||||||
]b4_location_if(
|
]b4_location_if(
|
||||||
[[ /* Default location. */
|
[[ /* Default location. */
|
||||||
YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);]])[
|
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);]])[
|
||||||
YY_REDUCE_PRINT (yyn);
|
YY_REDUCE_PRINT (yyn);
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
@@ -1427,7 +1427,7 @@ yyerrlab1:
|
|||||||
yyerror_range[1] = yylloc;
|
yyerror_range[1] = yylloc;
|
||||||
/* Using YYLLOC is tempting, but would change the location of
|
/* Using YYLLOC is tempting, but would change the location of
|
||||||
the look-ahead. YYLOC is available though. */
|
the look-ahead. YYLOC is available though. */
|
||||||
YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
|
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
|
||||||
*++yylsp = yyloc;]])[
|
*++yylsp = yyloc;]])[
|
||||||
|
|
||||||
/* Shift the error token. */
|
/* Shift the error token. */
|
||||||
|
|||||||
Reference in New Issue
Block a user