yacc.c: prefer YYSYMBOL_YYERROR to YYSYMBOL_error

* data/skeletons/bison.m4 (b4_symbol_sid): Map "error" to YYSYMBOL_YYERROR.
* data/skeletons/yacc.c: Adjust.
This commit is contained in:
Akim Demaille
2020-03-28 16:41:23 +01:00
parent d7f39ac507
commit 75a605454d
3 changed files with 8 additions and 23 deletions

16
TODO
View File

@@ -53,22 +53,6 @@ would actually also make the following point gracefully handled (status of
YYERRCODE, YYUNDEFTOK, etc.). Possibly we could also define YYEMPTY (twice:
as a token and as a symbol). And YYEOF.
It seems to work well. Yet we have a weird case: the "error" token:
enum yysymbol_type_t
{
YYSYMBOL_YYEMPTY = -2,
YYSYMBOL_YYEOF = 0,
YYSYMBOL_error = 1,
YYSYMBOL_YYUNDEF = 2,
YYSYMBOL_YYACCEPT = 61,
...
YYSYMBOL_error looks weird. We should maybe rename this as
"YYSYMBOL_YYERROR", even though it should not be confonded with the YYERROR
macro.
** Consistency
YYUNDEFTOK is an internal symbol number, as YYTERROR.
But YYERRCODE is an external token number.