mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
When reducing initial empty rules, Bison parser read an initial
location that is not defined. This results in garbage, and that affects Bison's own parser. Therefore we need (i) to extend Bison to support a means to initialize this location, and (ii) to use this CVS Bison to fix CVS Bison's parser. * src/reader.h, reader.c (epilogue_augment): Remove, replace with... * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this. * src/parse-gram.y: Adjust. (%initial-action): New. (%error-verbose): Since we require CVS Bison, there is no reason not to use it. * src/scan-gram.l: Adjust. * src/Makefile.am (YACC): New, to make sure we use our own parser. * data/yacc.c (yyparse): Use b4_initial_action.
This commit is contained in:
12
data/yacc.c
12
data/yacc.c
@@ -807,7 +807,17 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
|
||||
yyssp = yyss;
|
||||
yyvsp = yyvs;
|
||||
]b4_location_if([ yylsp = yyls;])[
|
||||
goto yysetstate;
|
||||
]m4_ifdef([b4_initial_action], [
|
||||
m4_pushdef([b4_at_dollar], [(*yylsp)])dnl
|
||||
m4_pushdef([b4_dollar_dollar], [(*yyvsp)])dnl
|
||||
/* User initialization code. */
|
||||
b4_initial_action
|
||||
m4_popdef([b4_dollar_dollar])dnl
|
||||
m4_popdef([b4_at_dollar])dnl
|
||||
/* Line __line__ of yacc.c. */
|
||||
b4_syncline([@oline@], [@ofile@])])dnl
|
||||
|
||||
[ goto yysetstate;
|
||||
|
||||
/*------------------------------------------------------------.
|
||||
| yynewstate -- Push a new state, which is found in yystate. |
|
||||
|
||||
Reference in New Issue
Block a user