]> git.saurik.com Git - bison.git/blobdiff - data/lalr1.cc
maint: run "make update-copyright"
[bison.git] / data / lalr1.cc
index f4cadc0effa4bfa24a8c5bf3cebd8cbf8331d45e..86cc71359930fc6a7e5b6705996ef82f87558ded 100644 (file)
@@ -1,7 +1,6 @@
 # C++ skeleton for Bison
 
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 2002-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
@@ -35,7 +34,7 @@ m4_divert_push(0)dnl
 b4_defines_if(
 [@output(b4_spec_defines_file@)@
 b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
-             [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009])
+             [2002-2010])
 dnl FIXME: This is wrong, we want computed header guards.
 [
 /* C++ LALR(1) parser skeleton written by Akim Demaille.  */
@@ -233,12 +232,10 @@ b4_user_stype
 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
     /// For a symbol, its name in clear.
     static const char* const yytname_[];
-#endif
+#endif]b4_error_verbose_if([
 
-#if YYERROR_VERBOSE
     /// Convert the symbol name \a n to a form suitable for a diagnostic.
-    virtual std::string yytnamerr_ (const char *n);
-#endif
+    static std::string yytnamerr_ (const char *n);])[
 
 #if YYDEBUG
     /// A type to store symbol numbers and -1.
@@ -307,7 +304,7 @@ b4_percent_code_get([[provides]])[]dnl
 ])dnl
 @output(b4_parser_file_name@)@
 b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
-             [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009])
+             [2002-2010])
 b4_percent_code_get([[top]])[]dnl
 m4_if(b4_prefix, [yy], [],
 [
@@ -384,8 +381,7 @@ do {                                        \
 #define YYERROR                goto yyerrorlab
 #define YYRECOVERING()  (!!yyerrstatus_)
 
-]b4_namespace_open[
-#if YYERROR_VERBOSE
+]b4_namespace_open[]b4_error_verbose_if([[
 
   /* Return YYSTR after stripping away unnecessary quotes and
      backslashes, so that it's suitable for yyerror.  The heuristic is
@@ -423,8 +419,7 @@ do {                                        \
 
     return yystr;
   }
-
-#endif
+]])[
 
   /// Build a parser object.
   ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
@@ -849,12 +844,11 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
 
   // Generate an error message.
   std::string
-  ]b4_parser_class_name[::yysyntax_error_ (int yystate, int]dnl
-b4_error_verbose_if([ yytoken])[)
+  ]b4_parser_class_name[::yysyntax_error_ (]dnl
+b4_error_verbose_if([int yystate, int yytoken],
+                    [int, int])[)
   {
-    std::string yyres;
-    YYUSE (yystate);
-#if YYERROR_VERBOSE
+    std::string yyres;]b4_error_verbose_if([[
     int yyn = yypact_[yystate];
     if (yypact_ninf_ < yyn && yyn <= yylast_)
       {
@@ -867,7 +861,8 @@ b4_error_verbose_if([ yytoken])[)
        int yychecklim = yylast_ - yyn + 1;
        int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
 
-        // Number of "expected" tokens.
+        // Number of reported tokens (one for the "unexpected", one per
+        // "expected").
        size_t yycount = 0;
         // Its maximum.
         enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
@@ -913,8 +908,8 @@ b4_error_verbose_if([ yytoken])[)
             yyres += *yyp;
       }
     else
-#endif
-      yyres = YY_("syntax error");
+  ]])dnl
+[    yyres = YY_("syntax error");
     return yyres;
   }
 
@@ -1096,7 +1091,7 @@ b4_error_verbose_if([ yytoken])[)
 dnl
 @output(b4_dir_prefix[]stack.hh@)@
 b4_copyright([Stack handling for Bison parsers in C++],
-             [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009])[
+             [2002-2010])[
 
 #ifndef BISON_STACK_HH
 # define BISON_STACK_HH