X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/9104636b039b322fe29f64cc1546ecd94812ef46..bcbbf654863dd285b176a0f54a75a28c4bdac1d3:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index 8623847e..5e77f844 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -230,22 +230,27 @@ m4_define([b4_declare_parser_state_variables], [b4_pure_if([[ # Declaration of yyparse (and dependencies) when using the push parser # (including in pull mode). m4_define([b4_declare_yyparse_push_], -[[typedef struct ]b4_prefix[pstate ]b4_prefix[pstate; +[[#ifndef YYPUSH_MORE_DEFINED +# define YYPUSH_MORE_DEFINED enum { YYPUSH_MORE = 4 }; +#endif + +typedef struct ]b4_prefix[pstate ]b4_prefix[pstate; + ]b4_pull_if([b4_c_function_decl([b4_prefix[parse]], [[int]], b4_parse_param) ])b4_c_function_decl([b4_prefix[push_parse]], [[int]], - [[b4_prefix[pstate *yyps]], [[yyps]]]b4_pure_if([, - [[[int yypushed_char]], [[yypushed_char]]], - [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([, - [[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [, + [[b4_prefix[pstate *ps]], [[ps]]]b4_pure_if([, + [[[int pushed_char]], [[pushed_char]]], + [[b4_api_PREFIX[STYPE const *pushed_val]], [[pushed_val]]]b4_locations_if([, + [[b4_api_PREFIX[LTYPE const *pushed_loc]], [[pushed_loc]]]])])m4_ifset([b4_parse_param], [, b4_parse_param])) b4_pull_if([b4_c_function_decl([b4_prefix[pull_parse]], [[int]], - [[b4_prefix[pstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [, + [[b4_prefix[pstate *ps]], [[ps]]]m4_ifset([b4_parse_param], [, b4_parse_param]))]) b4_c_function_decl([b4_prefix[pstate_new]], [b4_prefix[pstate *]], [[[void]], []]) b4_c_function_decl([b4_prefix[pstate_delete]], [[void]], - [[b4_prefix[pstate *yyps]], [[yyps]]])dnl + [[b4_prefix[pstate *ps]], [[ps]]])dnl ]) # b4_declare_yyparse_ @@ -740,31 +745,9 @@ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - +]b4_yylloc_default_define[ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif]b4_locations_if([[ +]b4_locations_if([[ /* YY_LOCATION_PRINT -- Print the location on the stream.