help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why token are numbered from 258?


From: Akim Demaille
Subject: Re: Why token are numbered from 258?
Date: Fri, 8 Feb 2019 06:17:45 +0100


> Le 8 févr. 2019 à 01:26, Peng Yu <address@hidden> a écrit :
> 
> OK. I find 256. But 257 is not found anywhere in y.tab.c or y.tab.h?

In the debugging code.

#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "IF", "$accept", "exp", YY_NULLPTR
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
   (internal) symbol number NUM (which must be that of a token).  */
static const yytype_uint16 yytoknum[] =
{
       0,   256,   257,   258
};
# endif


> y.tab.c:#define YYERRCODE       256
> 
> Also, YYERRCODE is not found in the manual, should it be mentioned there?

Unless we find some good reason for users to use that value, I'd rather
not commit myself to anything.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]