X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/723fe7d18a058e8764beb0c50fbcfa554ee5f6c4..62e5fc6ac9bd59f801ca43e7eb81d19960f3e306:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index 7c84f796..96eea2a8 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -2,8 +2,8 @@ # Yacc compatible skeleton for Bison -# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, +# Inc. # 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 @@ -29,8 +29,8 @@ m4_case(b4_percent_define_get([[api.push-pull]]), [push], [m4_define([b4_pull_flag], [[0]])]) # Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing -# tests function as written, don't let BISON_USE_PUSH_FOR_PULL modify Bison's -# behavior at all when push parsing is already requested. +# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the +# behavior of Bison at all when push parsing is already requested. b4_define_flag_if([use_push_for_pull]) b4_use_push_for_pull_if([ b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])], @@ -233,8 +233,8 @@ m4_define([b4_declare_parser_state_variables], [b4_pure_if([[ m4_changecom() m4_divert_push(0)dnl @output(b4_parser_file_name@)@ -b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C], - [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010])[ +b4_copyright([Bison implementation for Yacc-like parsers in C], + [1984, 1989-1990, 2000-2011])[ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ @@ -437,6 +437,7 @@ b4_push_if([], [b4_lac_if([], [[ # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && ]b4_c_modern[ # include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -533,20 +534,20 @@ union yyalloc #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ while (YYID (0)) # endif # endif @@ -712,18 +713,19 @@ static const ]b4_int_type_for([b4_stos])[ yystos[] = #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \]b4_lac_if([[ - YY_LAC_DISCARD ("YYBACKUP"); \]])[ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \]b4_lac_if([[ + YY_LAC_DISCARD ("YYBACKUP"); \]])[ + goto yybackup; \ + } \ + else \ + { \ yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \ YYERROR; \ } \ @@ -1134,7 +1136,7 @@ yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes, } *++yyesp = yystate; } - YYDPRINTF ((stderr, " G%d", *yyesp)); + YYDPRINTF ((stderr, " G%d", yystate)); } } }]])[ @@ -2017,7 +2019,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if ]b4_lac_if([[1]], [[!defined(yyoverflow) || YYERROR_VERBOSE]])[ +#if ]b4_lac_if([[1]], [[!defined yyoverflow || YYERROR_VERBOSE]])[ /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2067,8 +2069,8 @@ yypushreturn:]])[ ]b4_epilogue b4_defines_if( [@output(b4_spec_defines_file@)@ -b4_copyright([Skeleton interface for Bison's Yacc-like parsers in C], - [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010]) +b4_copyright([Bison interface for Yacc-like parsers in C], + [1984, 1989-1990, 2000-2011]) b4_percent_code_get([[requires]])[]dnl