mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
c++: style changes
Instead of
parser::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that)
: super_type (that.state, that.location)
{
value = that.value;
}
generate
parser::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that)
: super_type (that.state, that.value, that.location)
{}
* data/lalr1.cc (stack_symbol_type): Improve the copy ctor, when not
using the variants.
(yypush_): Rename arguments for clarity.
This commit is contained in:
@@ -332,9 +332,9 @@ b4_location_define])])[
|
|||||||
/// Push a new state on the stack.
|
/// Push a new state on the stack.
|
||||||
/// \param m a debug message to display
|
/// \param m a debug message to display
|
||||||
/// if null, no trace is output.
|
/// if null, no trace is output.
|
||||||
/// \param s the symbol
|
/// \param sym the symbol
|
||||||
/// \warning the contents of \a s.value is stolen.
|
/// \warning the contents of \a s.value is stolen.
|
||||||
void yypush_ (const char* m, stack_symbol_type& s);
|
void yypush_ (const char* m, stack_symbol_type& sym);
|
||||||
|
|
||||||
/// Push a new look ahead token on the state on the stack.
|
/// Push a new look ahead token on the state on the stack.
|
||||||
/// \param m a debug message to display
|
/// \param m a debug message to display
|
||||||
@@ -586,11 +586,10 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that)
|
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that)
|
||||||
: super_type (that.state]b4_locations_if([, that.location])[)
|
: super_type (that.state]b4_variant_if([], [, that.value])[]b4_locations_if([, that.location])[)
|
||||||
{
|
{]b4_variant_if([
|
||||||
]b4_variant_if([b4_symbol_variant([that.type_get ()],
|
b4_symbol_variant([that.type_get ()],
|
||||||
[value], [copy], [that.value])],
|
[value], [copy], [that.value])])[
|
||||||
[[value = that.value;]])[
|
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
|
]b4_parser_class_name[::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
|
||||||
@@ -646,6 +645,14 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void
|
||||||
|
]b4_parser_class_name[::yypush_ (const char* m, stack_symbol_type& sym)
|
||||||
|
{
|
||||||
|
if (m)
|
||||||
|
YY_SYMBOL_PRINT (m, sym);
|
||||||
|
yystack_.push (sym);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yypush_ (const char* m, state_type s, symbol_type& sym)
|
]b4_parser_class_name[::yypush_ (const char* m, state_type s, symbol_type& sym)
|
||||||
{
|
{
|
||||||
@@ -653,14 +660,6 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
yypush_ (m, t);
|
yypush_ (m, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
]b4_parser_class_name[::yypush_ (const char* m, stack_symbol_type& s)
|
|
||||||
{
|
|
||||||
if (m)
|
|
||||||
YY_SYMBOL_PRINT (m, s);
|
|
||||||
yystack_.push (s);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
]b4_parser_class_name[::yypop_ (unsigned n)
|
]b4_parser_class_name[::yypop_ (unsigned n)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user