X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/b9278c7d174c1be5d7482343c5e433f428657ed0..66c209cf435b5bfc5cf982d8df9cc3ef05b4546b:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index 7a2587ab..88277a91 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -1,11 +1,11 @@ -*- C -*- # Yacc compatible skeleton for Bison -# Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, +# Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, # Inc. m4_pushdef([b4_copyright_years], - [1984, 1989-1990, 2000-2012]) + [1984, 1989-1990, 2000-2013]) # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -100,15 +100,6 @@ m4_define([b4_yyerror_args], m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])]) -# b4_lex_param -# ------------ -# Accumulate in b4_lex_param all the yylex arguments. -# b4_lex_param arrives quoted twice, but we want to keep only one level. -m4_define([b4_lex_param], -m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl -b4_locations_if([, [[YYLTYPE *], [&yylloc]]])m4_ifdef([b4_lex_param], [, ])])dnl -m4_ifdef([b4_lex_param], b4_lex_param))) - ## ------------ ## ## Data Types. ## @@ -355,11 +346,12 @@ m4_if(b4_api_prefix, [yy], [], #define yypstate ]b4_prefix[pstate]])[ #define yylex ]b4_prefix[lex #define yyerror ]b4_prefix[error -#define yylval ]b4_prefix[lval -#define yychar ]b4_prefix[char #define yydebug ]b4_prefix[debug -#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[ -#define yylloc ]b4_prefix[lloc]])])[ +#define yynerrs ]b4_prefix[nerrs +]]b4_pure_if([], [[ +#define yylval ]b4_prefix[lval +#define yychar ]b4_prefix[char]b4_locations_if([[ +#define yylloc ]b4_prefix[lloc]])]))[ /* Copy the first part of user declarations. */ ]b4_user_pre_prologue[ @@ -613,7 +605,7 @@ static const ]b4_int_type_for([b4_translate])[ yytranslate[] = #if ]b4_api_PREFIX[DEBUG ]b4_integral_parser_table_define([rline], [b4_rline], - [YYRLINE[YYN] -- Source line where rule number YYN was defined.])[ + [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[ #endif #if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[ @@ -684,14 +676,6 @@ while (0) ]b4_yylloc_default_define[ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) ]])[ -]b4_yy_location_print_define[ - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (]b4_pure_if([&yylval[]b4_locations_if([, &yylloc]), ])[YYLEX_PARAM) -#else -# define YYLEX ]b4_function_call([yylex], [int], b4_lex_param)[ -#endif /* Enable debugging if requested. */ #if ]b4_api_PREFIX[DEBUG @@ -707,6 +691,8 @@ do { \ YYFPRINTF Args; \ } while (0) +]b4_yy_location_print_define[ + # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ @@ -1336,7 +1322,7 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[ } } do { - yychar = YYLEX; + yychar = ]b4_lex[; yystatus = yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[); } while (yystatus == YYPUSH_MORE); @@ -1597,7 +1583,7 @@ yyread_pushed_token:]])[ yylval = *yypushed_val;]b4_locations_if([[ if (yypushed_loc) yylloc = *yypushed_loc;]])])], [[ - yychar = YYLEX;]])[ + yychar = ]b4_lex[;]])[ } if (yychar <= YYEOF) @@ -1820,7 +1806,7 @@ yyerrorlab: goto yyerrorlab; ]b4_locations_if([[ yyerror_range[1] = yylsp[1-yylen]; -]])[ /* Do not reclaim the symbols of the rule which action triggered +]])[ /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -1915,7 +1901,7 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp);