<http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
* src/parse-gram.y (prologue_declaration): For %push-parser, also set
pure_parser = true.
* data/push.c: Don't bother testing b4_push_if when deciding whether
to expand b4_declare_parser_variables globally.
(yypush_parse): Likewise in here.
* data/push.c (yypush_parse): Add b4_parse_param to arguments.
(yy_reduce_print): Reformat M4 for readability.
+2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
+
+ Make %push-parser imply %pure-parser. This fixes several bugs; see
+ <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
+ * src/parse-gram.y (prologue_declaration): For %push-parser, also set
+ pure_parser = true.
+ * data/push.c: Don't bother testing b4_push_if when deciding whether
+ to expand b4_declare_parser_variables globally.
+ (yypush_parse): Likewise in here.
+
+ * data/push.c (yypush_parse): Add b4_parse_param to arguments.
+ (yy_reduce_print): Reformat M4 for readability.
+
2006-12-15 Bob Rossi <bob@brasko.net>
and Joel Denny <jdenny@ces.clemson.edu>
2006-12-15 Bob Rossi <bob@brasko.net>
and Joel Denny <jdenny@ces.clemson.edu>
[[YYSTYPE *yyvsp], [yyvsp]],
b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],
])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
[[YYSTYPE *yyvsp], [yyvsp]],
b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],
])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
{
int yynrhs = yyr2[yyrule];
int yyi;
{
int yynrhs = yyr2[yyrule];
int yyi;
[[yypstate *yyps], [yyps]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
[[yypstate *yyps], [yyps]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
- b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]]))[
+ b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]])
+ m4_ifset([b4_parse_param], [, b4_parse_param]))[
],[#ifdef YYPARSE_PARAM
]b4_c_function_decl([yyparse], [int],
[[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
],[#ifdef YYPARSE_PARAM
]b4_c_function_decl([yyparse], [int],
[[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
])
m4_divert_pop([KILL])dnl# ====================== End of M4 code.
])
m4_divert_pop([KILL])dnl# ====================== End of M4 code.
-b4_push_if([],[b4_pure_if([],
- [b4_declare_parser_variables])])
+b4_pure_if([], [b4_declare_parser_variables])
b4_push_if([b4_declare_yyparse_variables])
b4_push_if([b4_declare_yyparse_variables])
b4_c_function_def([yypush_parse], [int], [[yypstate *yyps], [yyps]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
b4_c_function_def([yypush_parse], [int], [[yypstate *yyps], [yyps]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
- b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]]))],[
+ b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]])
+ m4_ifset([b4_parse_param], [, b4_parse_param]))],[
#ifdef YYPARSE_PARAM
b4_c_function_def([yyparse], [int], [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])
#else /* ! YYPARSE_PARAM */
#ifdef YYPARSE_PARAM
b4_c_function_def([yyparse], [int], [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])
#else /* ! YYPARSE_PARAM */
#endif])
{[
]b4_pure_if([b4_declare_parser_variables])[
#endif])
{[
]b4_pure_if([b4_declare_parser_variables])[
- ]b4_push_if([b4_declare_parser_variables])[
int yystate;
int yyn;
int yyresult;
int yystate;
int yyn;
int yyresult;
[[]b4_prefix[pstate *]b4_prefix[pstate], []b4_prefix[pstate]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
[[]b4_prefix[pstate *]b4_prefix[pstate], []b4_prefix[pstate]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
- b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]]))[
+ b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]])
+ m4_ifset([b4_parse_param], [, b4_parse_param]))[
enum { YYPUSH_MORE = 4 };])[
m4_ifdef([b4_provides],
enum { YYPUSH_MORE = 4 };])[
m4_ifdef([b4_provides],
/* Line 1269 of yacc.c */
#line 258 "parse-gram.y"
/* Line 1269 of yacc.c */
#line 258 "parse-gram.y"
- { push_parser = true; }
+ { push_parser = true; pure_parser = true; }
| "%output" "=" STRING { spec_outfile = $3; } /* deprecated */
| "%parse-param" "{...}" { add_param ("parse_param", $2, @2); }
| "%pure-parser" { pure_parser = true; }
| "%output" "=" STRING { spec_outfile = $3; } /* deprecated */
| "%parse-param" "{...}" { add_param ("parse_param", $2, @2); }
| "%pure-parser" { pure_parser = true; }
-| "%push-parser" { push_parser = true; }
+| "%push-parser" { push_parser = true; pure_parser = true; }
| "%require" STRING { version_check (&@2, $2); }
| "%skeleton" STRING { skeleton = $2; }
| "%token-table" { token_table_flag = true; }
| "%require" STRING { version_check (&@2, $2); }
| "%skeleton" STRING { skeleton = $2; }
| "%token-table" { token_table_flag = true; }