error: rename the error token from YYERRCODE to YYerror

See https://lists.gnu.org/r/bison-patches/2020-04/msg00162.html.

* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/glr.cc,
* data/skeletons/lalr1.java, doc/bison.texi,
* examples/c/bistromathic/parse.y, src/scan-gram.l, src/symtab.c
(YYERRCODE): Rename as...
(YYerror): this.
Adjust dependencies.
This commit is contained in:
Akim Demaille
2020-04-28 07:28:52 +02:00
parent 7346163840
commit cd4e799da4
16 changed files with 48 additions and 60 deletions

View File

@@ -427,7 +427,7 @@ m4_define([b4_symbol_kind],
m4_case([$1],
[-2], [[YYEMPTY]],
[0], [[YYEOF]],
[1], [[YYERRCODE]],
[1], [[YYerror]],
[2], [[YYUNDEF]],
[m4_case(b4_symbol([$1], [tag]),
[$accept], [[YYACCEPT]],

View File

@@ -439,7 +439,7 @@ m4_define([b4_symbol(-2, tag)], [[No symbol.]])
m4_if(b4_symbol(0, id), [YYEOF],
[m4_define([b4_symbol(0, id)], [b4_api_PREFIX[][EOF]])])
m4_define([b4_symbol(1, id)], [b4_api_PREFIX[][ERRCODE]])
m4_define([b4_symbol(1, id)], [b4_api_PREFIX[][error]])
m4_define([b4_symbol(2, id)], [b4_api_PREFIX[][UNDEF]])

View File

@@ -356,10 +356,10 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
]m4_define([b4_declare_symbol_enum],
[[typedef ]b4_namespace_ref[::]b4_parser_class[::symbol_kind_type yysymbol_kind_t;
#define ]b4_symbol_prefix[YYEMPTY ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYEMPTY
#define ]b4_symbol_prefix[YYERRCODE ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYERRCODE
#define ]b4_symbol_prefix[YYEOF ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYEOF
#define ]b4_symbol_prefix[YYUNDEF ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYUNDEF
#define ]b4_symbol_prefix[YYEMPTY ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYEMPTY
#define ]b4_symbol_prefix[YYerror ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYerror
#define ]b4_symbol_prefix[YYEOF ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYEOF
#define ]b4_symbol_prefix[YYUNDEF ]b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol_prefix[YYUNDEF
]])[
]b4_percent_code_get([[provides]])[
]m4_popdef([b4_parse_param])dnl

View File

@@ -615,7 +615,7 @@ b4_dollar_popdef[]dnl
yySymbolPrint ("Next token is", yytoken,
yylval]b4_locations_if([, yylloc])[);]])[
if (yytoken == SymbolKind.]b4_symbol_prefix[YYERRCODE)
if (yytoken == SymbolKind.]b4_symbol_prefix[YYerror)
{
// The scanner already issued an error message, process directly
// to error recovery. But do not keep the error token as