]> git.saurik.com Git - bison.git/blobdiff - data/lalr1.cc
* src/location.h (boundary): Note that a line or column equal
[bison.git] / data / lalr1.cc
index ef45107082c33c35f009074f3116882ddc361812..94fc91831ac308dc5f65af4d3cd550b75e9bab78 100644 (file)
@@ -32,12 +32,7 @@ m4_if(b4_defines_flag, 0, [],
 b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
              [2002, 2003, 2004, 2005])
 dnl FIXME: This is wrong, we want computed header guards.
-[/* As a special exception, when this parser skeleton is copied by
-   Bison into a Bison output file, you may use that output file
-   without restriction.  This special exception was added by the Free
-   Software Foundation for C++ LALR(1) parsers in version 2.2 of
-   Bison.  */
-
+[
 /* C++ LALR(1) parser skeleton written by Akim Demaille.  */
 
 #ifndef PARSER_HEADER_H
@@ -158,13 +153,20 @@ b4_syncline([@oline@], [@ofile@])],
 b4_error_verbose_if([, int tok])[);
 
 #if YYDEBUG
+    /// \brief Report a symbol value on the debug stream.
+    /// \param yytype       The token type.
+    /// \param yyvaluep     Its semantic value.
+    /// \param yylocationp  Its location.
+    virtual void yy_symbol_value_print_ (int yytype,
+                                        const semantic_type* yyvaluep,
+                                        const location_type* yylocationp);
     /// \brief Report a symbol on the debug stream.
     /// \param yytype       The token type.
     /// \param yyvaluep     Its semantic value.
     /// \param yylocationp  Its location.
-    virtual void yysymprint_ (int yytype,
-                             const semantic_type* yyvaluep,
-                             const location_type* yylocationp);
+    virtual void yy_symbol_print_ (int yytype,
+                                  const semantic_type* yyvaluep,
+                                  const location_type* yylocationp);
 #endif /* ! YYDEBUG */
 
 
@@ -336,7 +338,7 @@ do {                                                        \
   if (yydebug_)                                                \
     {                                                  \
       *yycdebug_ << Title << ' ';                      \
-      yysymprint_ ((Type), (Value), (Location));       \
+      yy_symbol_print_ ((Type), (Value), (Location));  \
       *yycdebug_ << std::endl;                         \
     }                                                  \
 } while (false)
@@ -424,26 +426,29 @@ namespace yy
   | Print this symbol on YYOUTPUT.  |
   `--------------------------------*/
 
-  void
-  ]b4_parser_class_name[::yysymprint_ (int yytype,
+  inline void
+  ]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
                            const semantic_type* yyvaluep, const location_type* yylocationp)
   {
-    /* Backward compatibility, but should be removed eventually.  */
-    std::ostream& cdebug_ = *yycdebug_;
-
-    YYUSE (!&cdebug_);
     YYUSE (yylocationp);
     YYUSE (yyvaluep);
-
-    *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
-            << ' ' << yytname_[yytype] << " ("
-               << *yylocationp << ": ";
     switch (yytype)
       {
   ]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
 [       default:
           break;
       }
+  }
+
+
+  void
+  ]b4_parser_class_name[::yy_symbol_print_ (int yytype,
+                           const semantic_type* yyvaluep, const location_type* yylocationp)
+  {
+    *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
+              << ' ' << yytname_[yytype] << " ("
+               << *yylocationp << ": ";
+    yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
     *yycdebug_ << ')';
   }
 #endif /* ! YYDEBUG */