X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/ccdc1577ef7fb32a5e30cb655337e7cd42b98987..47db7ed1a855e7cc3022201085970c994b568513:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index a98c4ed9..b3864e90 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -232,22 +232,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_ @@ -279,7 +284,7 @@ m4_define([b4_shared_declarations], [b4_cpp_guard_open([b4_spec_defines_file])[ ]b4_declare_yydebug[ ]b4_percent_code_get([[requires]])[ -]b4_token_enums_defines(b4_tokens)[ +]b4_token_enums_defines[ ]b4_declare_yylstype[ ]b4_declare_yyparse[ ]b4_percent_code_get([[provides]])[ @@ -633,21 +638,6 @@ static const ]b4_int_type_for([b4_toknum])[ yytoknum[] = #define YYERROR goto yyerrorlab -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ @@ -1172,10 +1162,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1764,9 +1750,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */