help-bison
[Top][All Lists]
Advanced

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

Re: Enum for token '0', EOF


From: Akim Demaille
Subject: Re: Enum for token '0', EOF
Date: Sun, 9 Jul 2006 06:59:22 +0200


Le 8 juil. 06 à 17:08, Joel E. Denny a écrit :

On Sat, 8 Jul 2006, Frans Englich wrote:

No, I don't have a need to put END in my grammar nor give it a semantic value,

I can't think of a need either. The results look buggy with the current
implementation, so maybe Bison should report an error for this usage.

A friend of mine was using END in his grammars in a very specific
place (he was making error recovery right before END), that's why
I didn't disable it.  Sure, it's wrong to play with it, but quickly
enough you have a grammar that generates an empty language if you
play too hard, so I didn't care about adding a safety net.


but I need to signal it in my hand written tokenizer(and it is messy to cast
0 to the yytokentype enum).

I'm guessing this feature was originally intended for no more than just
that (and giving the end token a user-friendly string alias).

No it was not.  The original motivation was truly to provide a string
alias while sticking to the existing interface for the other tokens.




reply via email to

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