mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
glr2.cc: introduce the yytranslate_ member function
* data/skeletons/c++.m4 (b4_yytranslate_define): Use static_cast rather than the YY_CAST macro. Avoids the need to define YY_CAST in the header. * data/skeletons/glr2.cc: Fix calls to b4_shared_declarations: pass the type of file we are in. Don't define YYTRANSLATE. (parser::yytranslate_): New, as in lalr1.cc. Adjust to use it. * tests/glr-regression.at: Adjust.
This commit is contained in:
@@ -602,7 +602,7 @@ m4_define([b4_yytranslate_define],
|
||||
if (t <= 0)
|
||||
return symbol_kind::]b4_symbol_prefix[YYEOF;
|
||||
else if (t <= code_max)
|
||||
return YY_CAST (symbol_kind_type, translate_table[t]);
|
||||
return static_cast <symbol_kind_type> (translate_table[t]);
|
||||
else
|
||||
return symbol_kind::]b4_symbol_prefix[YYUNDEF;]])[
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user