mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 00:03:03 +00:00
c++: also use symbol_type_type
Because of the insane current implementation of glr.cc, things are a bit nasty. We will rename symbol_number_type as symbol_type_type later, to keep this commit small. * data/skeletons/c++.m4 (b4_declare_symbol_enum): New. Also define YYNTOKENS to avoid type clashes when yyntokens_ was actually defined in another enum. Use it. (symbol_number_type): Be an alias of symbol_type_type. Use YYSYMBOL_YYEMPTY and the like. Use symbol_number_type where appropriate. (empty_symbol): Remove. (yytranslate_): Use symbol_number_type, not token_number_type. * data/skeletons/lalr1.cc: Use symbol_number_type where appropriate. Adjust to the replacement of empty_symbol by YYSYMBOL_YYEMPTY. (yy_error_token_, yy_undef_token_, yyeof_, yyntokens_): Remove. Adjust dependencies. * data/skeletons/glr.cc: Use symbol_number_type where appropriate. Forward definitions of YYSYMBOL_YYEMPTY, etc. to glr.c. * tests/headers.at: Accept YYNTOKENS and other YYSYMBOL_*. * tests/local.at (AT_YYERROR_DEFINE(c++)): Use symbol_number_type.
This commit is contained in:
@@ -749,13 +749,13 @@ void
|
||||
std::cerr << ctx.location () << ": ";]])[
|
||||
std::cerr << "syntax error";
|
||||
{
|
||||
int la = ctx.token ();
|
||||
if (la != empty_symbol)
|
||||
symbol_type_type la = ctx.token ();
|
||||
if (la != YYSYMBOL_YYEMPTY)
|
||||
fprintf (stderr, " on token [%s]", yysymbol_name (la));
|
||||
}
|
||||
{
|
||||
enum { TOKENMAX = 10 };
|
||||
int expected[TOKENMAX];
|
||||
symbol_type_type expected[TOKENMAX];
|
||||
int n = ctx.yyexpected_tokens (expected, TOKENMAX);
|
||||
if (0 < n)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user