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.
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison