skeletons: shorten b4_parser_class_name to b4_parser_class

* skeletons/c++.m4, skeletons/d.m4, skeletons/glr.c, skeletons/glr.cc,
* skeletons/java.m4, skeletons/lalr1.cc, skeletons/lalr1.d,
* skeletons/lalr1.java: Here.
This commit is contained in:
Akim Demaille
2019-01-01 16:44:41 +01:00
parent 0dfad676e3
commit 5be47a73e8
8 changed files with 99 additions and 99 deletions

View File

@@ -366,14 +366,14 @@ m4_define([b4_symbol_type_define],
m4_define([b4_public_types_define], m4_define([b4_public_types_define],
[[ // basic_symbol. [[ // basic_symbol.
template <typename Base> template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol () ]b4_parser_class[::basic_symbol<Base>::basic_symbol ()
: value ()]b4_locations_if([ : value ()]b4_locations_if([
, location ()])[ , location ()])[
{} {}
#if 201103L <= YY_CPLUSPLUS #if 201103L <= YY_CPLUSPLUS
template <typename Base> template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (basic_symbol&& that) ]b4_parser_class[::basic_symbol<Base>::basic_symbol (basic_symbol&& that)
: Base (std::move (that)) : Base (std::move (that))
, value (]b4_variant_if([], [std::move (that.value)]))b4_locations_if([ , value (]b4_variant_if([], [std::move (that.value)]))b4_locations_if([
, location (std::move (that.location))])[ , location (std::move (that.location))])[
@@ -384,7 +384,7 @@ m4_define([b4_public_types_define],
#endif #endif
template <typename Base> template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& that) ]b4_parser_class[::basic_symbol<Base>::basic_symbol (const basic_symbol& that)
: Base (that) : Base (that)
, value (]b4_variant_if([], [that.value]))b4_locations_if([ , value (]b4_variant_if([], [that.value]))b4_locations_if([
, location (that.location)])[ , location (that.location)])[
@@ -396,7 +396,7 @@ m4_define([b4_public_types_define],
]b4_variant_if([], [[ ]b4_variant_if([], [[
/// Constructor for valueless symbols. /// Constructor for valueless symbols.
template <typename Base> template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join( ]b4_parser_class[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::kind_type t], [typename Base::kind_type t],
b4_locations_if([YY_MOVE_REF (location_type) l]))[) b4_locations_if([YY_MOVE_REF (location_type) l]))[)
: Base (t) : Base (t)
@@ -405,7 +405,7 @@ m4_define([b4_public_types_define],
{} {}
template <typename Base> template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join( ]b4_parser_class[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::kind_type t], [typename Base::kind_type t],
[YY_RVREF (semantic_type) v], [YY_RVREF (semantic_type) v],
b4_locations_if([YY_RVREF (location_type) l]))[) b4_locations_if([YY_RVREF (location_type) l]))[)
@@ -417,14 +417,14 @@ m4_define([b4_public_types_define],
]b4_symbol_variant([this->type_get ()], [value], [YY_MOVE_OR_COPY], [YY_MOVE (v)])])[}]])[ ]b4_symbol_variant([this->type_get ()], [value], [YY_MOVE_OR_COPY], [YY_MOVE (v)])])[}]])[
template <typename Base> template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol () ]b4_parser_class[::basic_symbol<Base>::~basic_symbol ()
{ {
clear (); clear ();
} }
template <typename Base> template <typename Base>
void void
]b4_parser_class_name[::basic_symbol<Base>::clear () ]b4_parser_class[::basic_symbol<Base>::clear ()
{]b4_variant_if([[ {]b4_variant_if([[
// User destructor. // User destructor.
symbol_number_type yytype = this->type_get (); symbol_number_type yytype = this->type_get ();
@@ -444,14 +444,14 @@ m4_define([b4_public_types_define],
template <typename Base> template <typename Base>
bool bool
]b4_parser_class_name[::basic_symbol<Base>::empty () const YY_NOEXCEPT ]b4_parser_class[::basic_symbol<Base>::empty () const YY_NOEXCEPT
{ {
return Base::type_get () == empty_symbol; return Base::type_get () == empty_symbol;
} }
template <typename Base> template <typename Base>
void void
]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s) ]b4_parser_class[::basic_symbol<Base>::move (basic_symbol& s)
{ {
super_type::move (s); super_type::move (s);
]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move], ]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [move],
@@ -461,47 +461,47 @@ m4_define([b4_public_types_define],
} }
// by_type. // by_type.
]b4_inline([$1])b4_parser_class_name[::by_type::by_type () ]b4_inline([$1])b4_parser_class[::by_type::by_type ()
: type (empty_symbol) : type (empty_symbol)
{} {}
#if 201103L <= YY_CPLUSPLUS #if 201103L <= YY_CPLUSPLUS
]b4_inline([$1])b4_parser_class_name[::by_type::by_type (by_type&& that) ]b4_inline([$1])b4_parser_class[::by_type::by_type (by_type&& that)
: type (that.type) : type (that.type)
{ {
that.clear (); that.clear ();
} }
#endif #endif
]b4_inline([$1])b4_parser_class_name[::by_type::by_type (const by_type& that) ]b4_inline([$1])b4_parser_class[::by_type::by_type (const by_type& that)
: type (that.type) : type (that.type)
{} {}
]b4_inline([$1])b4_parser_class_name[::by_type::by_type (token_type t) ]b4_inline([$1])b4_parser_class[::by_type::by_type (token_type t)
: type (yytranslate_ (t)) : type (yytranslate_ (t))
{} {}
]b4_inline([$1])[void ]b4_inline([$1])[void
]b4_parser_class_name[::by_type::clear () ]b4_parser_class[::by_type::clear ()
{ {
type = empty_symbol; type = empty_symbol;
} }
]b4_inline([$1])[void ]b4_inline([$1])[void
]b4_parser_class_name[::by_type::move (by_type& that) ]b4_parser_class[::by_type::move (by_type& that)
{ {
type = that.type; type = that.type;
that.clear (); that.clear ();
} }
]b4_inline([$1])[int ]b4_inline([$1])[int
]b4_parser_class_name[::by_type::type_get () const YY_NOEXCEPT ]b4_parser_class[::by_type::type_get () const YY_NOEXCEPT
{ {
return type; return type;
} }
]b4_token_ctor_if([[ ]b4_token_ctor_if([[
]b4_inline([$1])b4_parser_class_name[::token_type ]b4_inline([$1])b4_parser_class[::token_type
]b4_parser_class_name[::by_type::token () const YY_NOEXCEPT ]b4_parser_class[::by_type::token () const YY_NOEXCEPT
{ {
// YYTOKNUM[NUM] -- (External) token number corresponding to the // YYTOKNUM[NUM] -- (External) token number corresponding to the
// (internal) symbol number NUM (which must be that of a token). */ // (internal) symbol number NUM (which must be that of a token). */
@@ -529,8 +529,8 @@ m4_define([b4_token_constructor_define], [])
# Define yytranslate_. Sometimes used in the header file ($1=hh), # Define yytranslate_. Sometimes used in the header file ($1=hh),
# sometimes in the cc file. # sometimes in the cc file.
m4_define([b4_yytranslate_define], m4_define([b4_yytranslate_define],
[ b4_inline([$1])b4_parser_class_name[::token_number_type [ b4_inline([$1])b4_parser_class[::token_number_type
]b4_parser_class_name[::yytranslate_ (]b4_token_ctor_if([token_type], ]b4_parser_class[::yytranslate_ (]b4_token_ctor_if([token_type],
[int])[ t) [int])[ t)
{ {
// YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to

View File

@@ -179,7 +179,7 @@ b4_percent_define_default([[stype]], [[YYSemanticType]])])
m4_define_default([b4_prefix], [[YY]]) m4_define_default([b4_prefix], [[YY]])
b4_percent_define_default([[parser_class_name]], [b4_prefix[]YYParser])]) b4_percent_define_default([[parser_class_name]], [b4_prefix[]YYParser])])
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])]) m4_define([b4_parser_class], [b4_percent_define_get([[parser_class_name]])])
#b4_percent_define_default([[location_type]], [Location])]) #b4_percent_define_default([[location_type]], [Location])])
m4_define([b4_location_type], b4_percent_define_ifdef([[location_type]],[b4_percent_define_get([[location_type]])],[YYLocation])) m4_define([b4_location_type], b4_percent_define_ifdef([[location_type]],[b4_percent_define_get([[location_type]])],[YYLocation]))

View File

@@ -777,7 +777,7 @@ yygetToken (int *yycharp][]b4_pure_if([, yyGLRStack* yystackp])[]b4_user_formals
*yycharp = ]b4_lex[; *yycharp = ]b4_lex[;
#if YY_EXCEPTIONS #if YY_EXCEPTIONS
} }
catch (const ]b4_namespace_ref[::]b4_parser_class_name[::syntax_error& yyexc) catch (const ]b4_namespace_ref[::]b4_parser_class[::syntax_error& yyexc)
{]b4_locations_if([ {]b4_locations_if([
yylloc = yyexc.location;])[ yylloc = yyexc.location;])[
yyerror (]b4_lyyerror_args[yyexc.what ()); yyerror (]b4_lyyerror_args[yyexc.what ());
@@ -859,7 +859,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
yystackp->yyerror_range[1].yystate.yyloc = *yylocp; yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
]])[]b4_glr_cc_if([[ ]])[]b4_glr_cc_if([[
#if YY_EXCEPTIONS #if YY_EXCEPTIONS
typedef ]b4_namespace_ref[::]b4_parser_class_name[::syntax_error syntax_error; typedef ]b4_namespace_ref[::]b4_parser_class[::syntax_error syntax_error;
try try
{ {
#endif // YY_EXCEPTIONS]])[ #endif // YY_EXCEPTIONS]])[

View File

@@ -49,7 +49,7 @@ m4_define([b4_pure_flag], [1])
m4_include(b4_skeletonsdir/[c++.m4]) m4_include(b4_skeletonsdir/[c++.m4])
b4_bison_locations_if([m4_include(b4_skeletonsdir/[location.cc])]) b4_bison_locations_if([m4_include(b4_skeletonsdir/[location.cc])])
m4_define([b4_parser_class_name], m4_define([b4_parser_class],
[b4_percent_define_get([[parser_class_name]])]) [b4_percent_define_get([[parser_class_name]])])
# Save the parse parameters. # Save the parse parameters.
@@ -60,10 +60,10 @@ m4_define([b4_parse_param_orig], m4_defn([b4_parse_param]))
# New ones. # New ones.
m4_ifset([b4_parse_param], m4_ifset([b4_parse_param],
[m4_define([b4_parse_param_wrap], [m4_define([b4_parse_param_wrap],
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]],] [[b4_namespace_ref::b4_parser_class[& yyparser], [[yyparser]]],]
m4_defn([b4_parse_param]))], m4_defn([b4_parse_param]))],
[m4_define([b4_parse_param_wrap], [m4_define([b4_parse_param_wrap],
[[b4_namespace_ref::b4_parser_class_name[& yyparser], [[yyparser]]]]) [[b4_namespace_ref::b4_parser_class[& yyparser], [[yyparser]]]])
]) ])
@@ -81,10 +81,10 @@ m4_define([b4_yy_symbol_print_define],
[static void], [static void],
[[FILE *], []], [[FILE *], []],
[[int yytype], [yytype]], [[int yytype], [yytype]],
[[const ]b4_namespace_ref::b4_parser_class_name[::semantic_type *yyvaluep], [[const ]b4_namespace_ref::b4_parser_class[::semantic_type *yyvaluep],
[yyvaluep]][]dnl [yyvaluep]][]dnl
b4_locations_if([, b4_locations_if([,
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], [[const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp],
[yylocationp]]]), [yylocationp]]]),
b4_parse_param)[ b4_parse_param)[
{ {
@@ -103,7 +103,7 @@ m4_defn([b4_initial_action])]))])[
[b4_syncline([@oline@], [@ofile@])[ [b4_syncline([@oline@], [@ofile@])[
]b4_function_declare([yyerror], ]b4_function_declare([yyerror],
[static void],b4_locations_if([ [static void],b4_locations_if([
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], [[const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp],
[yylocationp]],]) [yylocationp]],])
b4_parse_param, b4_parse_param,
[[const char* msg], [msg]])])[ [[const char* msg], [msg]])])[
@@ -136,7 +136,7 @@ m4_append([b4_epilogue],
]b4_function_define([yyerror], ]b4_function_define([yyerror],
[static void],b4_locations_if([ [static void],b4_locations_if([
[[const ]b4_namespace_ref::b4_parser_class_name[::location_type *yylocationp], [[const ]b4_namespace_ref::b4_parser_class[::location_type *yylocationp],
[yylocationp]],]) [yylocationp]],])
b4_parse_param, b4_parse_param,
[[const char* msg], [msg]])[ [[const char* msg], [msg]])[
@@ -150,24 +150,24 @@ m4_append([b4_epilogue],
]dnl In this section, the parse params are the original parse_params. ]dnl In this section, the parse params are the original parse_params.
m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
[ /// Build a parser object. [ /// Build a parser object.
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ ]b4_parser_class::b4_parser_class[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
:])[ :])[
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
]m4_ifset([b4_parse_param], [ ], [ :])[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[ #endif]b4_parse_param_cons[
{} {}
]b4_parser_class_name::~b4_parser_class_name[ () ]b4_parser_class::~b4_parser_class[ ()
{} {}
int int
]b4_parser_class_name[::operator() () ]b4_parser_class[::operator() ()
{ {
return parse (); return parse ();
} }
int int
]b4_parser_class_name[::parse () ]b4_parser_class[::parse ()
{ {
return ::yyparse (*this]b4_user_args[); return ::yyparse (*this]b4_user_args[);
} }
@@ -178,7 +178,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
`--------------------*/ `--------------------*/
void void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype, ]b4_parser_class[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep]b4_locations_if([[, const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[) const location_type* yylocationp]])[)
{]b4_locations_if([[ {]b4_locations_if([[
@@ -192,7 +192,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
void void
]b4_parser_class_name[::yy_symbol_print_ (int yytype, ]b4_parser_class[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep]b4_locations_if([[, const semantic_type* yyvaluep]b4_locations_if([[,
const location_type* yylocationp]])[) const location_type* yylocationp]])[)
{ {
@@ -204,26 +204,26 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
} }
std::ostream& std::ostream&
]b4_parser_class_name[::debug_stream () const ]b4_parser_class[::debug_stream () const
{ {
return *yycdebug_; return *yycdebug_;
} }
void void
]b4_parser_class_name[::set_debug_stream (std::ostream& o) ]b4_parser_class[::set_debug_stream (std::ostream& o)
{ {
yycdebug_ = &o; yycdebug_ = &o;
} }
]b4_parser_class_name[::debug_level_type ]b4_parser_class[::debug_level_type
]b4_parser_class_name[::debug_level () const ]b4_parser_class[::debug_level () const
{ {
return yydebug; return yydebug;
} }
void void
]b4_parser_class_name[::set_debug_level (debug_level_type l) ]b4_parser_class[::set_debug_level (debug_level_type l)
{ {
// Actually, it is yydebug which is really used. // Actually, it is yydebug which is really used.
yydebug = l; yydebug = l;
@@ -267,14 +267,14 @@ b4_percent_code_get([[requires]])[
[b4_location_define])])[ [b4_location_define])])[
/// A Bison parser. /// A Bison parser.
class ]b4_parser_class_name[ class ]b4_parser_class[
{ {
public: public:
]b4_public_types_declare[ ]b4_public_types_declare[
/// Build a parser object. /// Build a parser object.
]b4_parser_class_name[ (]b4_parse_param_decl[); ]b4_parser_class[ (]b4_parse_param_decl[);
virtual ~]b4_parser_class_name[ (); virtual ~]b4_parser_class[ ();
/// Parse. An alias for parse (). /// Parse. An alias for parse ().
/// \returns 0 iff parsing succeeded. /// \returns 0 iff parsing succeeded.
@@ -331,10 +331,10 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
[b4_token_defines]) [b4_token_defines])
[ [
#ifndef ]b4_api_PREFIX[STYPE #ifndef ]b4_api_PREFIX[STYPE
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type # define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class[::semantic_type
#endif #endif
#ifndef ]b4_api_PREFIX[LTYPE #ifndef ]b4_api_PREFIX[LTYPE
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class_name[::location_type # define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class[::location_type
#endif #endif
]b4_namespace_close[ ]b4_namespace_close[

View File

@@ -196,7 +196,7 @@ b4_percent_define_default([[api.value.type]], [[Object]])
m4_define_default([b4_prefix], [[YY]]) m4_define_default([b4_prefix], [[YY]])
b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser]) b4_percent_define_default([[parser_class_name]], [b4_prefix[]Parser])
m4_define([b4_parser_class_name], [b4_percent_define_get([[parser_class_name]])]) m4_define([b4_parser_class], [b4_percent_define_get([[parser_class_name]])])
b4_percent_define_default([[lex_throws]], [[java.io.IOException]]) b4_percent_define_default([[lex_throws]], [[java.io.IOException]])
m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])]) m4_define([b4_lex_throws], [b4_percent_define_get([[lex_throws]])])

View File

@@ -35,7 +35,7 @@ m4_define([b4_integral_parser_table_declare],
# Define "parser::yy<TABLE-NAME>_" whose contents is CONTENT. # Define "parser::yy<TABLE-NAME>_" whose contents is CONTENT.
m4_define([b4_integral_parser_table_define], m4_define([b4_integral_parser_table_define],
[ const b4_int_type_for([$2]) [ const b4_int_type_for([$2])
b4_parser_class_name::yy$1_[[]] = b4_parser_class::yy$1_[[]] =
{ {
$2 $2
};dnl };dnl
@@ -137,7 +137,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
m4_pushdef([b4_copyright_years], m4_pushdef([b4_copyright_years],
[2002-2015, 2018]) [2002-2015, 2018])
m4_define([b4_parser_class_name], m4_define([b4_parser_class],
[b4_percent_define_get([[parser_class_name]])]) [b4_percent_define_get([[parser_class_name]])])
b4_bison_locations_if([# Backward compatibility. b4_bison_locations_if([# Backward compatibility.
@@ -176,14 +176,14 @@ m4_define([b4_shared_declarations],
[b4_location_define])])[ [b4_location_define])])[
/// A Bison parser. /// A Bison parser.
class ]b4_parser_class_name[ class ]b4_parser_class[
{ {
public: public:
]b4_public_types_declare[ ]b4_public_types_declare[
]b4_symbol_type_define[ ]b4_symbol_type_define[
/// Build a parser object. /// Build a parser object.
]b4_parser_class_name[ (]b4_parse_param_decl[); ]b4_parser_class[ (]b4_parse_param_decl[);
virtual ~]b4_parser_class_name[ (); virtual ~]b4_parser_class[ ();
/// Parse. An alias for parse (). /// Parse. An alias for parse ().
/// \returns 0 iff parsing succeeded. /// \returns 0 iff parsing succeeded.
@@ -219,8 +219,8 @@ m4_define([b4_shared_declarations],
private: private:
/// This class is not copyable. /// This class is not copyable.
]b4_parser_class_name[ (const ]b4_parser_class_name[&); ]b4_parser_class[ (const ]b4_parser_class[&);
]b4_parser_class_name[& operator= (const ]b4_parser_class_name[&); ]b4_parser_class[& operator= (const ]b4_parser_class[&);
/// State numbers. /// State numbers.
typedef int state_type; typedef int state_type;
@@ -388,7 +388,7 @@ m4_define([b4_shared_declarations],
#ifndef ]b4_api_PREFIX[STYPE #ifndef ]b4_api_PREFIX[STYPE
// Redirection for backward compatibility. // Redirection for backward compatibility.
# define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class_name::semantic_type # define ]b4_api_PREFIX[STYPE b4_namespace_ref::b4_parser_class::semantic_type
#endif #endif
])[ ])[
]b4_percent_code_get([[provides]])[ ]b4_percent_code_get([[provides]])[
@@ -515,7 +515,7 @@ m4_if(b4_prefix, [yy], [],
apostrophe, a comma, or backslash (other than backslash-backslash). apostrophe, a comma, or backslash (other than backslash-backslash).
YYSTR is taken from yytname. */ YYSTR is taken from yytname. */
std::string std::string
]b4_parser_class_name[::yytnamerr_ (const char *yystr) ]b4_parser_class[::yytnamerr_ (const char *yystr)
{ {
if (*yystr == '"') if (*yystr == '"')
{ {
@@ -548,7 +548,7 @@ m4_if(b4_prefix, [yy], [],
]])[ ]])[
/// Build a parser object. /// Build a parser object.
]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ ]b4_parser_class::b4_parser_class[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [
:])[ :])[
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false), ]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
@@ -556,7 +556,7 @@ m4_if(b4_prefix, [yy], [],
#endif]b4_parse_param_cons[ #endif]b4_parse_param_cons[
{} {}
]b4_parser_class_name::~b4_parser_class_name[ () ]b4_parser_class::~b4_parser_class[ ()
{} {}
@@ -567,33 +567,33 @@ m4_if(b4_prefix, [yy], [],
]b4_token_ctor_if([], [b4_public_types_define([cc])])[ ]b4_token_ctor_if([], [b4_public_types_define([cc])])[
// by_state. // by_state.
]b4_parser_class_name[::by_state::by_state () YY_NOEXCEPT ]b4_parser_class[::by_state::by_state () YY_NOEXCEPT
: state (empty_state) : state (empty_state)
{} {}
]b4_parser_class_name[::by_state::by_state (const by_state& that) YY_NOEXCEPT ]b4_parser_class[::by_state::by_state (const by_state& that) YY_NOEXCEPT
: state (that.state) : state (that.state)
{} {}
void void
]b4_parser_class_name[::by_state::clear () YY_NOEXCEPT ]b4_parser_class[::by_state::clear () YY_NOEXCEPT
{ {
state = empty_state; state = empty_state;
} }
void void
]b4_parser_class_name[::by_state::move (by_state& that) ]b4_parser_class[::by_state::move (by_state& that)
{ {
state = that.state; state = that.state;
that.clear (); that.clear ();
} }
]b4_parser_class_name[::by_state::by_state (state_type s) YY_NOEXCEPT ]b4_parser_class[::by_state::by_state (state_type s) YY_NOEXCEPT
: state (s) : state (s)
{} {}
]b4_parser_class_name[::symbol_number_type ]b4_parser_class[::symbol_number_type
]b4_parser_class_name[::by_state::type_get () const YY_NOEXCEPT ]b4_parser_class[::by_state::type_get () const YY_NOEXCEPT
{ {
if (state == empty_state) if (state == empty_state)
return empty_symbol; return empty_symbol;
@@ -601,10 +601,10 @@ m4_if(b4_prefix, [yy], [],
return yystos_[state]; return yystos_[state];
} }
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type () ]b4_parser_class[::stack_symbol_type::stack_symbol_type ()
{} {}
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) ]b4_parser_class[::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
: super_type (YY_MOVE (that.state)]b4_variant_if([], [, YY_MOVE (that.value)])b4_locations_if([, YY_MOVE (that.location)])[) : super_type (YY_MOVE (that.state)]b4_variant_if([], [, YY_MOVE (that.value)])b4_locations_if([, YY_MOVE (that.location)])[)
{]b4_variant_if([ {]b4_variant_if([
b4_symbol_variant([that.type_get ()], b4_symbol_variant([that.type_get ()],
@@ -615,7 +615,7 @@ m4_if(b4_prefix, [yy], [],
#endif #endif
} }
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) ]b4_parser_class[::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
: super_type (s]b4_variant_if([], [, YY_MOVE (that.value)])[]b4_locations_if([, YY_MOVE (that.location)])[) : super_type (s]b4_variant_if([], [, YY_MOVE (that.value)])[]b4_locations_if([, YY_MOVE (that.location)])[)
{]b4_variant_if([ {]b4_variant_if([
b4_symbol_variant([that.type_get ()], b4_symbol_variant([that.type_get ()],
@@ -625,8 +625,8 @@ m4_if(b4_prefix, [yy], [],
} }
#if YY_CPLUSPLUS < 201103L #if YY_CPLUSPLUS < 201103L
]b4_parser_class_name[::stack_symbol_type& ]b4_parser_class[::stack_symbol_type&
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that) ]b4_parser_class[::stack_symbol_type::operator= (stack_symbol_type& that)
{ {
state = that.state; state = that.state;
]b4_variant_if([b4_symbol_variant([that.type_get ()], ]b4_variant_if([b4_symbol_variant([that.type_get ()],
@@ -641,7 +641,7 @@ m4_if(b4_prefix, [yy], [],
template <typename Base> template <typename Base>
void void
]b4_parser_class_name[::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const ]b4_parser_class[::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
{ {
if (yymsg) if (yymsg)
YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [ YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [
@@ -653,7 +653,7 @@ m4_if(b4_prefix, [yy], [],
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
template <typename Base> template <typename Base>
void void
]b4_parser_class_name[::yy_print_ (std::ostream& yyo, ]b4_parser_class[::yy_print_ (std::ostream& yyo,
const basic_symbol<Base>& yysym) const const basic_symbol<Base>& yysym) const
{ {
std::ostream& yyoutput = yyo; std::ostream& yyoutput = yyo;
@@ -672,7 +672,7 @@ m4_if(b4_prefix, [yy], [],
#endif #endif
void void
]b4_parser_class_name[::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) ]b4_parser_class[::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
{ {
if (m) if (m)
YY_SYMBOL_PRINT (m, sym); YY_SYMBOL_PRINT (m, sym);
@@ -680,7 +680,7 @@ m4_if(b4_prefix, [yy], [],
} }
void void
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) ]b4_parser_class[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
{ {
#if 201103L <= YY_CPLUSPLUS #if 201103L <= YY_CPLUSPLUS
yypush_ (m, stack_symbol_type (s, std::move (sym))); yypush_ (m, stack_symbol_type (s, std::move (sym)));
@@ -691,40 +691,40 @@ m4_if(b4_prefix, [yy], [],
} }
void void
]b4_parser_class_name[::yypop_ (int n) ]b4_parser_class[::yypop_ (int n)
{ {
yystack_.pop (n); yystack_.pop (n);
} }
#if ]b4_api_PREFIX[DEBUG #if ]b4_api_PREFIX[DEBUG
std::ostream& std::ostream&
]b4_parser_class_name[::debug_stream () const ]b4_parser_class[::debug_stream () const
{ {
return *yycdebug_; return *yycdebug_;
} }
void void
]b4_parser_class_name[::set_debug_stream (std::ostream& o) ]b4_parser_class[::set_debug_stream (std::ostream& o)
{ {
yycdebug_ = &o; yycdebug_ = &o;
} }
]b4_parser_class_name[::debug_level_type ]b4_parser_class[::debug_level_type
]b4_parser_class_name[::debug_level () const ]b4_parser_class[::debug_level () const
{ {
return yydebug_; return yydebug_;
} }
void void
]b4_parser_class_name[::set_debug_level (debug_level_type l) ]b4_parser_class[::set_debug_level (debug_level_type l)
{ {
yydebug_ = l; yydebug_ = l;
} }
#endif // ]b4_api_PREFIX[DEBUG #endif // ]b4_api_PREFIX[DEBUG
]b4_parser_class_name[::state_type ]b4_parser_class[::state_type
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yysym) ]b4_parser_class[::yy_lr_goto_state_ (state_type yystate, int yysym)
{ {
int yyr = yypgoto_[yysym - yyntokens_] + yystate; int yyr = yypgoto_[yysym - yyntokens_] + yystate;
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
@@ -734,25 +734,25 @@ m4_if(b4_prefix, [yy], [],
} }
bool bool
]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue) ]b4_parser_class[::yy_pact_value_is_default_ (int yyvalue)
{ {
return yyvalue == yypact_ninf_; return yyvalue == yypact_ninf_;
} }
bool bool
]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue) ]b4_parser_class[::yy_table_value_is_error_ (int yyvalue)
{ {
return yyvalue == yytable_ninf_; return yyvalue == yytable_ninf_;
} }
int int
]b4_parser_class_name[::operator() () ]b4_parser_class[::operator() ()
{ {
return parse (); return parse ();
} }
int int
]b4_parser_class_name[::parse () ]b4_parser_class[::parse ()
{ {
// State. // State.
int yyn; int yyn;
@@ -1075,7 +1075,7 @@ b4_dollar_popdef])[]dnl
} }
void void
]b4_parser_class_name[::error (const syntax_error& yyexc) ]b4_parser_class[::error (const syntax_error& yyexc)
{ {
error (]b4_join(b4_locations_if([yyexc.location]), error (]b4_join(b4_locations_if([yyexc.location]),
[[yyexc.what ()]])[); [[yyexc.what ()]])[);
@@ -1083,7 +1083,7 @@ b4_dollar_popdef])[]dnl
// Generate an error message. // Generate an error message.
std::string std::string
]b4_parser_class_name[::yysyntax_error_ (]dnl ]b4_parser_class[::yysyntax_error_ (]dnl
b4_error_verbose_if([state_type yystate, const symbol_type& yyla], b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
[state_type, const symbol_type&])[) const [state_type, const symbol_type&])[) const
{]b4_error_verbose_if([[ {]b4_error_verbose_if([[
@@ -1182,9 +1182,9 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
} }
const ]b4_int_type(b4_pact_ninf, b4_pact_ninf) b4_parser_class_name::yypact_ninf_ = b4_pact_ninf[; const ]b4_int_type(b4_pact_ninf, b4_pact_ninf) b4_parser_class::yypact_ninf_ = b4_pact_ninf[;
const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class_name::yytable_ninf_ = b4_table_ninf[; const ]b4_int_type(b4_table_ninf, b4_table_ninf) b4_parser_class::yytable_ninf_ = b4_table_ninf[;
]b4_parser_tables_define[ ]b4_parser_tables_define[
@@ -1192,7 +1192,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
// YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
// First, the terminals, then, starting at \a yyntokens_, nonterminals. // First, the terminals, then, starting at \a yyntokens_, nonterminals.
const char* const char*
const ]b4_parser_class_name[::yytname_[] = const ]b4_parser_class[::yytname_[] =
{ {
]b4_tname[ ]b4_tname[
}; };
@@ -1202,7 +1202,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
// Print the state stack on the debug stream. // Print the state stack on the debug stream.
void void
]b4_parser_class_name[::yystack_print_ () ]b4_parser_class[::yystack_print_ ()
{ {
*yycdebug_ << "Stack now"; *yycdebug_ << "Stack now";
for (stack_type::const_iterator for (stack_type::const_iterator
@@ -1215,7 +1215,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
// Report on the debug stream that the rule \a yyrule is going to be reduced. // Report on the debug stream that the rule \a yyrule is going to be reduced.
void void
]b4_parser_class_name[::yy_reduce_print_ (int yyrule) ]b4_parser_class[::yy_reduce_print_ (int yyrule)
{ {
unsigned yylno = yyrline_[yyrule]; unsigned yylno = yyrline_[yyrule];
int yynrhs = yyr2_[yyrule]; int yynrhs = yyr2_[yyrule];

View File

@@ -44,7 +44,7 @@ import std.format;
/** /**
* Communication interface between the scanner and the Bison-generated * Communication interface between the scanner and the Bison-generated
* parser <tt>]b4_parser_class_name[</tt>. * parser <tt>]b4_parser_class[</tt>.
*/ */
public interface Lexer public interface Lexer
{ {
@@ -233,7 +233,7 @@ b4_user_union_members
]b4_public_if([public ])dnl ]b4_public_if([public ])dnl
b4_abstract_if([abstract ])dnl b4_abstract_if([abstract ])dnl
b4_final_if([final ])dnl b4_final_if([final ])dnl
[class ]b4_parser_class_name[]dnl [class ]b4_parser_class[]dnl
b4_percent_define_get3([extends], [ extends ])dnl b4_percent_define_get3([extends], [ extends ])dnl
b4_percent_define_get3([implements], [ implements ])[ b4_percent_define_get3([implements], [ implements ])[
{ {

View File

@@ -100,7 +100,7 @@ b4_public_if([public ])dnl
b4_abstract_if([abstract ])dnl b4_abstract_if([abstract ])dnl
b4_final_if([final ])dnl b4_final_if([final ])dnl
b4_strictfp_if([strictfp ])dnl b4_strictfp_if([strictfp ])dnl
[class ]b4_parser_class_name[]dnl [class ]b4_parser_class[]dnl
b4_percent_define_get3([extends], [ extends ])dnl b4_percent_define_get3([extends], [ extends ])dnl
b4_percent_define_get3([implements], [ implements ])[ b4_percent_define_get3([implements], [ implements ])[
{ {
@@ -187,7 +187,7 @@ b4_locations_if([[
/** /**
* Communication interface between the scanner and the Bison-generated * Communication interface between the scanner and the Bison-generated
* parser <tt>]b4_parser_class_name[</tt>. * parser <tt>]b4_parser_class[</tt>.
*/ */
public interface Lexer { public interface Lexer {
/** Token returned by the scanner to signal the end of its input. */ /** Token returned by the scanner to signal the end of its input. */
@@ -247,7 +247,7 @@ b4_lexer_if([[
/** /**
* Instantiates the Bison-generated parser. * Instantiates the Bison-generated parser.
*/ */
public ]b4_parser_class_name (b4_parse_param_decl([b4_lex_param_decl])[) ]b4_maybe_throws([b4_init_throws])[ public ]b4_parser_class (b4_parse_param_decl([b4_lex_param_decl])[) ]b4_maybe_throws([b4_init_throws])[
{ {
]b4_percent_code_get([[init]])[ ]b4_percent_code_get([[init]])[
this.yylexer = new YYLexer(]b4_lex_param_call[); this.yylexer = new YYLexer(]b4_lex_param_call[);
@@ -259,7 +259,7 @@ b4_lexer_if([[
* Instantiates the Bison-generated parser. * Instantiates the Bison-generated parser.
* @@param yylexer The scanner that will supply tokens to the parser. * @@param yylexer The scanner that will supply tokens to the parser.
*/ */
b4_lexer_if([[protected]], [[public]]) b4_parser_class_name[ (]b4_parse_param_decl([[Lexer yylexer]])[) ]b4_maybe_throws([b4_init_throws])[ b4_lexer_if([[protected]], [[public]]) b4_parser_class[ (]b4_parse_param_decl([[Lexer yylexer]])[) ]b4_maybe_throws([b4_init_throws])[
{ {
]b4_percent_code_get([[init]])[ ]b4_percent_code_get([[init]])[
this.yylexer = yylexer; this.yylexer = yylexer;