X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/88654b47c9e3c75670df802a5b901ec0ff4fe8f5..c826013fb38c98861ef0fc5d4dc3fb3fb4f555be:/data/glr.cc diff --git a/data/glr.cc b/data/glr.cc index 8463bb7a..feed669a 100644 --- a/data/glr.cc +++ b/data/glr.cc @@ -1,6 +1,5 @@ # C++ GLR skeleton for Bison -# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 @@ -44,7 +43,7 @@ # filename member). # We require a pure interface using locations. -m4_define([b4_locations_flag], [1]) +m4_define([b4_percent_define(locations)], []) m4_define([b4_pure_flag], [1]) # The header is mandatory. @@ -123,8 +122,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ :])[ #if YYDEBUG - ]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false), - yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ + ]m4_ifset([b4_parse_param], [ ], [ :])[yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ #endif]b4_parse_param_cons[ { } @@ -187,13 +185,13 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl ]b4_parser_class_name[::debug_level_type ]b4_parser_class_name[::debug_level () const { - return yydebug_; + return yydebug; } void ]b4_parser_class_name[::set_debug_level (debug_level_type l) { - yydebug_ = l; + yydebug = l; } #endif @@ -216,7 +214,7 @@ m4_popdef([b4_parse_param]) m4_divert_push(0) @output(b4_spec_defines_file@)@ b4_copyright([Skeleton interface for Bison GLR parsers in C++], - [2002, 2003, 2004, 2005, 2006])[ + [2002-2010])[ /* C++ GLR parser skeleton written by Akim Demaille. */ @@ -225,22 +223,17 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++], ]b4_percent_code_get([[requires]])[ +#include #include #include +#include "location.hh" /* Using locations. */ -#define YYLSP_NEEDED ]b4_locations_flag[ - -]b4_namespace_open[ - class position; - class location; -]b4_namespace_close[ - -#include "location.hh" +#define YYLSP_NEEDED ]b4_locations_if([1], [0])[ /* Enabling traces. */ #ifndef YYDEBUG -# define YYDEBUG ]b4_debug_flag[ +# define YYDEBUG ]b4_parse_trace_if([1], [0])[ #endif /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. @@ -267,28 +260,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++], class ]b4_parser_class_name[ { public: - /// Symbol semantic values. -#ifndef YYSTYPE -]m4_ifdef([b4_stype], -[ union semantic_type - { -b4_user_stype - };], -[m4_if(b4_tag_seen_flag, 0, -[[ typedef int semantic_type;]], -[[ typedef YYSTYPE semantic_type;]])])[ -#else - typedef YYSTYPE semantic_type; -#endif - /// Symbol locations. - typedef ]b4_percent_define_get([[location_type]])[ location_type; - /// Tokens. - struct token - { - ]b4_token_enums(b4_tokens)[ - }; - /// Token type. - typedef token::yytokentype token_type; +]b4_public_types_declare[ /// Build a parser object. ]b4_parser_class_name[ (]b4_parse_param_decl[); @@ -334,7 +306,6 @@ b4_user_stype const location_type* yylocationp); private: /* Debugging. */ - int yydebug_; std::ostream* yycdebug_; #endif