]> git.saurik.com Git - bison.git/blobdiff - data/yacc.c
Prepare for 2.4.2 release.
[bison.git] / data / yacc.c
index b871118a39d54fe695cb3de1e45c71f51c42f4ed..67e18404508433d57963cd0a71a0ad80aacb4ee6 100644 (file)
@@ -2,8 +2,8 @@
 
 # Yacc compatible skeleton for Bison
 
-# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1984, 1989-1990, 2000-2010 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
@@ -153,9 +153,9 @@ m4_define([b4_rhs_location],
 # We do want M4 expansion after # for CPP macros.
 m4_changecom()
 m4_divert_push(0)dnl
-@output(b4_parser_file_name@)
-b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C],dnl '
-  [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])[
+@output(b4_parser_file_name@)@
+b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C],
+             [1984, 1989-1990, 2000-2006, 2009-2010])[
 
 /* C LALR(1) parser skeleton written by Richard Stallman, by
    simplifying the original so-called "semantic" parser.  */
@@ -310,7 +310,7 @@ typedef short int yytype_int16;
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -609,9 +609,18 @@ static const ]b4_int_type_for([b4_stos])[ yystos[] =
 
 /* 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.  */
+   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)
 
@@ -668,7 +677,7 @@ while (YYID (0))
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)                 \
      fprintf (File, "%d.%d-%d.%d",                     \
              (Loc).first_line, (Loc).first_column,     \
@@ -1191,9 +1200,9 @@ b4_push_if([b4_pure_if([], [[  int yypushed_char = yychar;
   int yytoken;
   /* The variables used to return semantic value and location from the
      action routines.  */
-  YYSTYPE yyval;
-]b4_locations_if([[  YYLTYPE yyloc;
-]])[
+  YYSTYPE yyval;]b4_locations_if([[
+  YYLTYPE yyloc;]])[
+
 #if YYERROR_VERBOSE
   /* Buffer for error messages, and its allocated size.  */
   char yymsgbuf[128];
@@ -1205,19 +1214,18 @@ b4_push_if([b4_pure_if([], [[  int yypushed_char = yychar;
 
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-]b4_push_if([[
+  int yylen = 0;]b4_push_if([[
+
   if (!yyps->yynew)
     {
       yyn = yypact[yystate];
       goto yyread_pushed_token;
-    }
-]])[
+    }]])[
+
   yytoken = 0;
   yyss = yyssa;
-  yyvs = yyvsa;
-]b4_locations_if([[  yyls = yylsa;
-]])[
+  yyvs = yyvsa;]b4_locations_if([[
+  yyls = yylsa;]])[
   yystacksize = YYINITDEPTH;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1235,7 +1243,7 @@ b4_push_if([b4_pure_if([], [[  int yypushed_char = yychar;
   yyvsp = yyvs;]b4_locations_if([[
   yylsp = yyls;
 
-#if YYLTYPE_IS_TRIVIAL
+#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   /* Initialize the default location before parsing starts.  */
   yylloc.first_line   = yylloc.last_line   = ]b4_location_initial_line[;
   yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
@@ -1354,33 +1362,29 @@ yybackup:
 
   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
-    {
-]b4_push_if([[      if (!yyps->yynew)
-        {
-]b4_use_push_for_pull_if([],
-[[          YYDPRINTF ((stderr, "Return for a new token:\n"));
-]])[          yyresult = YYPUSH_MORE;
+    {]b4_push_if([[
+      if (!yyps->yynew)
+        {]b4_use_push_for_pull_if([], [[
+          YYDPRINTF ((stderr, "Return for a new token:\n"));]])[
+          yyresult = YYPUSH_MORE;
           goto yypushreturn;
         }
-      yyps->yynew = 0;
-]b4_pure_if([], [[
+      yyps->yynew = 0;]b4_pure_if([], [[
       /* Restoring the pushed token is only necessary for the first
          yypush_parse invocation since subsequent invocations don't overwrite
          it before jumping to yyread_pushed_token.  */
       yychar = yypushed_char;
-      yylval = yypushed_val;
-      ]b4_locations_if([[yylloc = yypushed_loc;
-]])])[
-yyread_pushed_token:
-]])[      YYDPRINTF ((stderr, "Reading a token: "));
-]b4_push_if([b4_pure_if([[      yychar = yypushed_char;
+      yylval = yypushed_val;]b4_locations_if([[
+      yylloc = yypushed_loc;]])])[
+yyread_pushed_token:]])[
+      YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[
+      yychar = yypushed_char;
       if (yypushed_val)
-        yylval = *yypushed_val;
-]b4_locations_if([[      if (yypushed_loc)
-        yylloc = *yypushed_loc;
-]])])],
-[[      yychar = YYLEX;
-]])[    }
+        yylval = *yypushed_val;]b4_locations_if([[
+      if (yypushed_loc)
+        yylloc = *yypushed_loc;]])])], [[
+      yychar = YYLEX;]])[
+    }
 
   if (yychar <= YYEOF)
     {
@@ -1679,9 +1683,9 @@ yypushreturn:
 
 ]b4_epilogue
 b4_defines_if(
-[@output(b4_spec_defines_file@)
-b4_copyright([Skeleton interface for Bison's Yacc-like parsers in C],dnl '
-  [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006])
+[@output(b4_spec_defines_file@)@
+b4_copyright([Skeleton interface for Bison's Yacc-like parsers in C],
+             [1984, 1989-1990, 2000-2006, 2009-2010])
 
 b4_percent_code_get([[requires]])[]dnl