X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/eeb29422377c730846f784716f22be1759491bcf..6721294104e47dd932e755d4d5352407859a4663:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index da7c72c7..52c8fae6 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -2,10 +2,10 @@ # Yacc compatible skeleton for Bison # Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -# 2007, 2008 Free Software Foundation, Inc. +# 2007, 2008, 2009 Free Software Foundation, Inc. m4_pushdef([b4_copyright_years], -[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008]) +[1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009]) # 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 @@ -20,13 +20,13 @@ m4_pushdef([b4_copyright_years], # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check the value of %define api.push_pull. -b4_percent_define_default([[api.push_pull]], [[pull]]) -b4_percent_define_check_values([[[[api.push_pull]], +# Check the value of %define api.push-pull. +b4_percent_define_default([[api.push-pull]], [[pull]]) +b4_percent_define_check_values([[[[api.push-pull]], [[pull]], [[push]], [[both]]]]) b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]]) b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]]) -m4_case(b4_percent_define_get([[api.push_pull]]), +m4_case(b4_percent_define_get([[api.push-pull]]), [pull], [m4_define([b4_push_flag], [[0]])], [push], [m4_define([b4_pull_flag], [[0]])]) @@ -192,7 +192,7 @@ m4_if(b4_prefix, [yy], [], /* Enabling traces. */ #ifndef YYDEBUG -# define YYDEBUG ]b4_debug_flag[ +# define YYDEBUG ]b4_parse_trace_if([1], [0])[ #endif /* Enabling verbose error messages. */ @@ -200,7 +200,7 @@ m4_if(b4_prefix, [yy], [], # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else -# define YYERROR_VERBOSE ]b4_error_verbose_flag[ +# define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[ #endif /* Enabling the token table. */ @@ -822,14 +822,14 @@ yytnamerr (char *yyres, const char *yystr) # endif /* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, + YYTOKEN while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +yysyntax_error (char *yyresult, int yystate, int yytoken) { int yyn = yypact[yystate]; @@ -837,8 +837,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar) return 0; else { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; @@ -860,7 +859,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar) int yycount = 0; int yyx; - yyarg[yycount++] = yytname[yytype]; + yyarg[yycount++] = yytname[yytoken]; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) @@ -1417,7 +1416,7 @@ yyerrlab: yyerror (]b4_yyerror_args[YY_("syntax error")); #else { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + YYSIZE_T yysize = yysyntax_error (0, yystate, yytoken); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; @@ -1437,7 +1436,7 @@ yyerrlab: if (0 < yysize && yysize <= yymsg_alloc) { - (void) yysyntax_error (yymsg, yystate, yychar); + (void) yysyntax_error (yymsg, yystate, yytoken); yyerror (]b4_yyerror_args[yymsg); } else @@ -1597,8 +1596,7 @@ yypushreturn: return YYID (yyresult); } - -]b4_epilogue +]b4_epilogue[]dnl b4_defines_if( [@output(b4_spec_defines_file@)@ b4_copyright([Interface for Bison's Yacc-like parsers in C])dnl'