mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -35,7 +35,7 @@ m4_define([b4_integral_parser_table_declare],
|
||||
# Define "parser::yy<TABLE-NAME>_" whose contents is CONTENT.
|
||||
m4_define([b4_integral_parser_table_define],
|
||||
[ const b4_int_type_for([$2])
|
||||
b4_parser_class_name::yy$1_[[]] =
|
||||
b4_parser_class::yy$1_[[]] =
|
||||
{
|
||||
$2
|
||||
};dnl
|
||||
@@ -137,7 +137,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015, 2018])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
m4_define([b4_parser_class],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
|
||||
b4_bison_locations_if([# Backward compatibility.
|
||||
@@ -176,14 +176,14 @@ m4_define([b4_shared_declarations],
|
||||
[b4_location_define])])[
|
||||
|
||||
/// A Bison parser.
|
||||
class ]b4_parser_class_name[
|
||||
class ]b4_parser_class[
|
||||
{
|
||||
public:
|
||||
]b4_public_types_declare[
|
||||
]b4_symbol_type_define[
|
||||
/// Build a parser object.
|
||||
]b4_parser_class_name[ (]b4_parse_param_decl[);
|
||||
virtual ~]b4_parser_class_name[ ();
|
||||
]b4_parser_class[ (]b4_parse_param_decl[);
|
||||
virtual ~]b4_parser_class[ ();
|
||||
|
||||
/// Parse. An alias for parse ().
|
||||
/// \returns 0 iff parsing succeeded.
|
||||
@@ -219,8 +219,8 @@ m4_define([b4_shared_declarations],
|
||||
|
||||
private:
|
||||
/// This class is not copyable.
|
||||
]b4_parser_class_name[ (const ]b4_parser_class_name[&);
|
||||
]b4_parser_class_name[& operator= (const ]b4_parser_class_name[&);
|
||||
]b4_parser_class[ (const ]b4_parser_class[&);
|
||||
]b4_parser_class[& operator= (const ]b4_parser_class[&);
|
||||
|
||||
/// State numbers.
|
||||
typedef int state_type;
|
||||
@@ -388,7 +388,7 @@ m4_define([b4_shared_declarations],
|
||||
|
||||
#ifndef ]b4_api_PREFIX[STYPE
|
||||
// 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
|
||||
])[
|
||||
]b4_percent_code_get([[provides]])[
|
||||
@@ -515,7 +515,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
apostrophe, a comma, or backslash (other than backslash-backslash).
|
||||
YYSTR is taken from yytname. */
|
||||
std::string
|
||||
]b4_parser_class_name[::yytnamerr_ (const char *yystr)
|
||||
]b4_parser_class[::yytnamerr_ (const char *yystr)
|
||||
{
|
||||
if (*yystr == '"')
|
||||
{
|
||||
@@ -548,7 +548,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
]])[
|
||||
|
||||
/// 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
|
||||
]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false),
|
||||
@@ -556,7 +556,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
#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])])[
|
||||
|
||||
// by_state.
|
||||
]b4_parser_class_name[::by_state::by_state () YY_NOEXCEPT
|
||||
]b4_parser_class[::by_state::by_state () YY_NOEXCEPT
|
||||
: 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)
|
||||
{}
|
||||
|
||||
void
|
||||
]b4_parser_class_name[::by_state::clear () YY_NOEXCEPT
|
||||
]b4_parser_class[::by_state::clear () YY_NOEXCEPT
|
||||
{
|
||||
state = empty_state;
|
||||
}
|
||||
|
||||
void
|
||||
]b4_parser_class_name[::by_state::move (by_state& that)
|
||||
]b4_parser_class[::by_state::move (by_state& that)
|
||||
{
|
||||
state = that.state;
|
||||
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)
|
||||
{}
|
||||
|
||||
]b4_parser_class_name[::symbol_number_type
|
||||
]b4_parser_class_name[::by_state::type_get () const YY_NOEXCEPT
|
||||
]b4_parser_class[::symbol_number_type
|
||||
]b4_parser_class[::by_state::type_get () const YY_NOEXCEPT
|
||||
{
|
||||
if (state == empty_state)
|
||||
return empty_symbol;
|
||||
@@ -601,10 +601,10 @@ m4_if(b4_prefix, [yy], [],
|
||||
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)])[)
|
||||
{]b4_variant_if([
|
||||
b4_symbol_variant([that.type_get ()],
|
||||
@@ -615,7 +615,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
#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)])[)
|
||||
{]b4_variant_if([
|
||||
b4_symbol_variant([that.type_get ()],
|
||||
@@ -625,8 +625,8 @@ m4_if(b4_prefix, [yy], [],
|
||||
}
|
||||
|
||||
#if YY_CPLUSPLUS < 201103L
|
||||
]b4_parser_class_name[::stack_symbol_type&
|
||||
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that)
|
||||
]b4_parser_class[::stack_symbol_type&
|
||||
]b4_parser_class[::stack_symbol_type::operator= (stack_symbol_type& that)
|
||||
{
|
||||
state = that.state;
|
||||
]b4_variant_if([b4_symbol_variant([that.type_get ()],
|
||||
@@ -641,7 +641,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
|
||||
template <typename Base>
|
||||
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)
|
||||
YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [
|
||||
@@ -653,7 +653,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
template <typename Base>
|
||||
void
|
||||
]b4_parser_class_name[::yy_print_ (std::ostream& yyo,
|
||||
]b4_parser_class[::yy_print_ (std::ostream& yyo,
|
||||
const basic_symbol<Base>& yysym) const
|
||||
{
|
||||
std::ostream& yyoutput = yyo;
|
||||
@@ -672,7 +672,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
#endif
|
||||
|
||||
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)
|
||||
YY_SYMBOL_PRINT (m, sym);
|
||||
@@ -680,7 +680,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
}
|
||||
|
||||
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
|
||||
yypush_ (m, stack_symbol_type (s, std::move (sym)));
|
||||
@@ -691,40 +691,40 @@ m4_if(b4_prefix, [yy], [],
|
||||
}
|
||||
|
||||
void
|
||||
]b4_parser_class_name[::yypop_ (int n)
|
||||
]b4_parser_class[::yypop_ (int n)
|
||||
{
|
||||
yystack_.pop (n);
|
||||
}
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
std::ostream&
|
||||
]b4_parser_class_name[::debug_stream () const
|
||||
]b4_parser_class[::debug_stream () const
|
||||
{
|
||||
return *yycdebug_;
|
||||
}
|
||||
|
||||
void
|
||||
]b4_parser_class_name[::set_debug_stream (std::ostream& o)
|
||||
]b4_parser_class[::set_debug_stream (std::ostream& o)
|
||||
{
|
||||
yycdebug_ = &o;
|
||||
}
|
||||
|
||||
|
||||
]b4_parser_class_name[::debug_level_type
|
||||
]b4_parser_class_name[::debug_level () const
|
||||
]b4_parser_class[::debug_level_type
|
||||
]b4_parser_class[::debug_level () const
|
||||
{
|
||||
return yydebug_;
|
||||
}
|
||||
|
||||
void
|
||||
]b4_parser_class_name[::set_debug_level (debug_level_type l)
|
||||
]b4_parser_class[::set_debug_level (debug_level_type l)
|
||||
{
|
||||
yydebug_ = l;
|
||||
}
|
||||
#endif // ]b4_api_PREFIX[DEBUG
|
||||
|
||||
]b4_parser_class_name[::state_type
|
||||
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yysym)
|
||||
]b4_parser_class[::state_type
|
||||
]b4_parser_class[::yy_lr_goto_state_ (state_type yystate, int yysym)
|
||||
{
|
||||
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
|
||||
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
||||
@@ -734,25 +734,25 @@ m4_if(b4_prefix, [yy], [],
|
||||
}
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
int
|
||||
]b4_parser_class_name[::operator() ()
|
||||
]b4_parser_class[::operator() ()
|
||||
{
|
||||
return parse ();
|
||||
}
|
||||
|
||||
int
|
||||
]b4_parser_class_name[::parse ()
|
||||
]b4_parser_class[::parse ()
|
||||
{
|
||||
// State.
|
||||
int yyn;
|
||||
@@ -1075,7 +1075,7 @@ b4_dollar_popdef])[]dnl
|
||||
}
|
||||
|
||||
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]),
|
||||
[[yyexc.what ()]])[);
|
||||
@@ -1083,7 +1083,7 @@ b4_dollar_popdef])[]dnl
|
||||
|
||||
// Generate an error message.
|
||||
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],
|
||||
[state_type, const symbol_type&])[) const
|
||||
{]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[
|
||||
|
||||
@@ -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.
|
||||
// First, the terminals, then, starting at \a yyntokens_, nonterminals.
|
||||
const char*
|
||||
const ]b4_parser_class_name[::yytname_[] =
|
||||
const ]b4_parser_class[::yytname_[] =
|
||||
{
|
||||
]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.
|
||||
void
|
||||
]b4_parser_class_name[::yystack_print_ ()
|
||||
]b4_parser_class[::yystack_print_ ()
|
||||
{
|
||||
*yycdebug_ << "Stack now";
|
||||
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.
|
||||
void
|
||||
]b4_parser_class_name[::yy_reduce_print_ (int yyrule)
|
||||
]b4_parser_class[::yy_reduce_print_ (int yyrule)
|
||||
{
|
||||
unsigned yylno = yyrline_[yyrule];
|
||||
int yynrhs = yyr2_[yyrule];
|
||||
|
||||
Reference in New Issue
Block a user