X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/279cabb657e5116d9fd4badace040f36f579199a..2f7a96b58f10a7f4e10f6fe1aa3c76e075b7c099:/data/lalr1.cc diff --git a/data/lalr1.cc b/data/lalr1.cc index 2d53bf9c..7ecc525b 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -3,27 +3,23 @@ # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, # Inc. -# This program is free software; you can redistribute it and/or modify +# 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 -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. - +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. - +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA +# along with this program. If not, see . m4_include(b4_pkgdatadir/[c++.m4]) m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])]) -m4_define([b4_namespace], - [b4_percent_define_get([[namespace]])]) # The header is mandatory. b4_defines_if([], @@ -53,11 +49,10 @@ dnl FIXME: This is wrong, we want computed header guards. #include #include "stack.hh" -namespace ]b4_namespace[ -{ +]b4_namespace_open[ class position; class location; -} +]b4_namespace_close[ #include "location.hh" @@ -98,8 +93,7 @@ do { \ } while (false) #endif -namespace ]b4_namespace[ -{ +]b4_namespace_open[ /// A Bison parser. class ]b4_parser_class_name[ @@ -288,14 +282,14 @@ b4_error_verbose_if([, int tok])[); static const token_number_type yyundef_token_; ]b4_parse_param_vars[ }; -} +]b4_namespace_close[ -]m4_ifval(b4_percent_define_get([[global_tokens_and_yystype]]), +]b4_percent_define_flag_if([[global_tokens_and_yystype]], [b4_token_defines(b4_tokens) #ifndef YYSTYPE /* Redirection for backward compatibility. */ -# define YYSTYPE b4_namespace::b4_parser_class_name::semantic_type +# define YYSTYPE b4_namespace_ref::b4_parser_class_name::semantic_type #endif ]) b4_percent_code_get([[provides]])[]dnl @@ -377,8 +371,7 @@ do { \ #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab -namespace ]b4_namespace[ -{ +]b4_namespace_open[ #if YYERROR_VERBOSE /* Return YYSTR after stripping away unnecessary quotes and @@ -1051,7 +1044,7 @@ b4_error_verbose_if([, int tok])[) const unsigned int ]b4_parser_class_name[::yyuser_token_number_max_ = ]b4_user_token_number_max[; const ]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::yyundef_token_ = ]b4_undef_token_number[; -} // namespace ]b4_namespace[ +]b4_namespace_close[ ]b4_epilogue dnl @@ -1064,8 +1057,7 @@ b4_copyright([Stack handling for Bison parsers in C++], #include -namespace ]b4_namespace[ -{ +]b4_namespace_open[ template > class stack { @@ -1151,7 +1143,7 @@ namespace ]b4_namespace[ const S& stack_; unsigned int range_; }; -} +]b4_namespace_close[ #endif // not BISON_STACK_HH] m4_divert_pop(0)