Re: Why token are numbered from 258?

Peng Yu <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <CABrM6wk_w3Nhfsc430+y6X1Pvp5uSn_23J6s6_q=9q+FVN+=_A@mail.gmail.com>
> 256 is the error token, and 257 is the undef token (when we receive unknown tokens from yylex).
>
> 256 is mandated by POSIX :
>
> https://pubs.opengroup.org/onlinepubs/007904875/utilities/yacc.html
>
> > The token error shall be reserved for error handling. The name error can be used in grammar rules. It indicates places where the parser can recover from a syntax error. The default value of error shall be 256. Its value can be changed using a %token declaration. The lexical analyzer should not return the value of error.
>
> It seems to say that we should be able to change the value with `%token error 2400`, but we don't support that.  (checking...)  OMG, we do support it!  New test case...

OK. I find 256. But 257 is not found anywhere in y.tab.c or y.tab.h?

y.tab.c:#define YYERRCODE       256

Also, YYERRCODE is not found in the manual, should it be mentioned there?

-- 
Regards,
Peng

_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.