xml: beware of user strings used to give a %prec to rules.
[bison.git] / data / yacc.c
index b871118a39d54fe695cb3de1e45c71f51c42f4ed..76a1baa47c6099eb2c1a18753a9411cd62c95e8a 100644 (file)
@@ -3,7 +3,7 @@
 # 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.
 
 # 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# 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]])])
 
@@ -153,9 +153,10 @@ 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@)
+@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])[
+  [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+   2009])[
 
 /* C LALR(1) parser skeleton written by Richard Stallman, by
    simplifying the original so-called "semantic" parser.  */
@@ -547,8 +548,8 @@ static const ]b4_int_type_for([b4_r2])[ yyr2[] =
   ]b4_r2[
 };
 
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
-   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
 static const ]b4_int_type_for([b4_defact])[ yydefact[] =
 {
@@ -1191,9 +1192,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 +1206,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"));
@@ -1354,33 +1354,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 +1675,10 @@ yypushreturn:
 
 ]b4_epilogue
 b4_defines_if(
-[@output(b4_spec_defines_file@)
+[@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])
+  [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+   2009])
 
 b4_percent_code_get([[requires]])[]dnl