X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/8bb4c753e2d626ee90460e6d9f9cbaa2cd1f560d..ddee1b066660d06c6c3bf0cf6f9884d79e6fee27:/data/lalr1.cc diff --git a/data/lalr1.cc b/data/lalr1.cc index dba89da6..e27cce48 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -2,7 +2,7 @@ m4_divert(-1) # C++ skeleton for Bison -# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2004, 2005, 2006 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 @@ -30,7 +30,7 @@ m4_divert(0)dnl m4_if(b4_defines_flag, 0, [], [@output @output_header_name@ b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], - [2002, 2003, 2004, 2005]) + [2002, 2003, 2004, 2005, 2006]) dnl FIXME: This is wrong, we want computed header guards. [ /* C++ LALR(1) parser skeleton written by Akim Demaille. */ @@ -104,10 +104,11 @@ namespace yy /// Symbol semantic values. #if ! defined (YYSTYPE) ]m4_ifdef([b4_stype], -[b4_syncline([b4_stype_line], [b4_file_name]) - union semantic_type b4_stype; +[ union semantic_type +b4_stype /* Line __line__ of lalr1.cc. */ -b4_syncline([@oline@], [@ofile@])], +b4_syncline([@oline@], [@ofile@]) + ;], [ typedef int semantic_type;])[ #else typedef YYSTYPE semantic_type; @@ -153,13 +154,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 */ @@ -288,7 +296,7 @@ b4_error_verbose_if([, int tok])[); ])dnl @output @output_parser_name@ b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], - [2002, 2003, 2004, 2005]) + [2002, 2003, 2004, 2005, 2006]) m4_if(b4_prefix[], [yy], [], [ // Take the name prefix into account. @@ -331,7 +339,7 @@ do { \ if (yydebug_) \ { \ *yycdebug_ << Title << ' '; \ - yysymprint_ ((Type), (Value), (Location)); \ + yy_symbol_print_ ((Type), (Value), (Location)); \ *yycdebug_ << std::endl; \ } \ } while (false) @@ -419,26 +427,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 */ @@ -1038,7 +1049,8 @@ b4_error_verbose_if([, int tok])[) ]b4_epilogue dnl @output b4_dir_prefix[]stack.hh -b4_copyright([stack handling for Bison C++ parsers], [2002, 2003, 2004, 2005])[ +b4_copyright([stack handling for Bison C++ parsers], + [2002, 2003, 2004, 2005, 2006])[ #ifndef BISON_STACK_HH # define BISON_STACK_HH