mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-23 11:13:03 +00:00
c++: provide yy::parser::symbol_type::name
* data/skeletons/c++.m4 (yy::parser::basic_symbol::name): New. * data/skeletons/lalr1.cc (yy_print_): Use it. * doc/bison.texi: Document. * tests/c++.at: Check.
This commit is contained in:
@@ -357,6 +357,29 @@ m4_define([b4_symbol_type_define],
|
||||
Base::clear ();
|
||||
}
|
||||
|
||||
]b4_parse_error_bmatch(
|
||||
[custom\|detailed],
|
||||
[[ /// The user-facing name of this symbol.
|
||||
const char *name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}]],
|
||||
[simple],
|
||||
[[#if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
/// The user-facing name of this symbol.
|
||||
const char *name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}
|
||||
#endif // #if ]b4_api_PREFIX[DEBUG || ]b4_token_table_flag[
|
||||
]],
|
||||
[verbose],
|
||||
[[ /// The user-facing name of this symbol.
|
||||
std::string name () const YY_NOEXCEPT
|
||||
{
|
||||
return ]b4_parser_class[::symbol_name (this->kind ());
|
||||
}]])[
|
||||
|
||||
/// Backward compatibility (Bison 3.6).
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user