mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
c, c++: rename yysymbol_type_t as yysymbol_kind_t
See https://lists.gnu.org/r/bison-patches/2020-04/msg00031.html * data/skeletons/c.m4, data/skeletons/glr.c, data/skeletons/yacc.c (yysymbol_type_t): Rename as... (yysymbol_kind_t): this. Adjust dependencies. * data/skeletons/c++.m4, data/skeletons/glr.cc, data/skeletons/lalr1.cc (symbol_type_type): Rename as... (symbol_kind_type): this. Adjust dependencies.
This commit is contained in:
@@ -188,7 +188,7 @@ m4_define([b4_token_enums],
|
||||
# Defining YYEMPTY here is important: it forces the compiler
|
||||
# to use a signed type, which matters for yytoken.
|
||||
m4_define([b4_declare_symbol_enum],
|
||||
[[enum symbol_type_type
|
||||
[[enum symbol_kind_type
|
||||
{
|
||||
]m4_join([,
|
||||
],
|
||||
@@ -322,7 +322,7 @@ m4_define([b4_symbol_type_define],
|
||||
void clear ()
|
||||
{]b4_variant_if([[
|
||||
// User destructor.
|
||||
symbol_type_type yytype = this->type_get ();
|
||||
symbol_kind_type yytype = this->type_get ();
|
||||
basic_symbol<Base>& yysym = *this;
|
||||
(void) yysym;
|
||||
switch (yytype)
|
||||
@@ -384,11 +384,11 @@ m4_define([b4_symbol_type_define],
|
||||
|
||||
/// The (internal) type number (corresponding to \a type).
|
||||
/// \a empty when empty.
|
||||
symbol_type_type type_get () const YY_NOEXCEPT;
|
||||
symbol_kind_type type_get () const YY_NOEXCEPT;
|
||||
|
||||
/// The symbol type.
|
||||
/// \a YYSYMBOL_YYEMPTY when empty.
|
||||
symbol_type_type type;
|
||||
symbol_kind_type type;
|
||||
};
|
||||
|
||||
/// "External" symbols: returned by the scanner.
|
||||
@@ -508,7 +508,7 @@ m4_define([b4_public_types_define],
|
||||
that.clear ();
|
||||
}
|
||||
|
||||
]b4_inline([$1])[]b4_parser_class[::symbol_type_type
|
||||
]b4_inline([$1])[]b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::by_type::type_get () const YY_NOEXCEPT
|
||||
{
|
||||
return type;
|
||||
@@ -528,11 +528,11 @@ m4_define([b4_token_constructor_define], [])
|
||||
# Define yytranslate_. Sometimes used in the header file ($1=hh),
|
||||
# sometimes in the cc file.
|
||||
m4_define([b4_yytranslate_define],
|
||||
[ b4_inline([$1])b4_parser_class[::symbol_type_type
|
||||
[ b4_inline([$1])b4_parser_class[::symbol_kind_type
|
||||
]b4_parser_class[::yytranslate_ (int t)
|
||||
{
|
||||
]b4_api_token_raw_if(
|
||||
[[ return static_cast<symbol_type_type> (t);]],
|
||||
[[ return static_cast<symbol_kind_type> (t);]],
|
||||
[[ // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
|
||||
// TOKEN-NUM as returned by yylex.
|
||||
static
|
||||
@@ -546,7 +546,7 @@ m4_define([b4_yytranslate_define],
|
||||
if (t <= 0)
|
||||
return YYSYMBOL_YYEOF;
|
||||
else if (t <= user_token_number_max_)
|
||||
return YY_CAST (symbol_type_type, translate_table[t]);
|
||||
return YY_CAST (symbol_kind_type, translate_table[t]);
|
||||
else
|
||||
return YYSYMBOL_YYUNDEF;]])[
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user