[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI: alias undeclared or declared after use
From: |
Joel E. Denny |
Subject: |
Re: FYI: alias undeclared or declared after use |
Date: |
Fri, 18 Aug 2006 14:02:18 -0400 (EDT) |
On Fri, 18 Aug 2006, Paul Eggert wrote:
> > As part of the fix, Bison now reports an error for any string literal that
> > is never declared as an alias.
>
> Thanks for the fix (and your reward will be to be asked for more fixes
> :-).
>
> Is it documented that string literals must be declared as aliases?
I don't believe so.
I just realized why my change might be wrong. %token-table reveals the
token number associated with any undeclared string literal. Thus, my
change may create a backward incompatibility in real parsers. (I also see
that /usr/ccs/bin/yacc on Solaris 10 doesn't reject them, but I haven't
tried to figure out the usefulness there.)
If non-aliased string literals are reasonable, it seems odd to me that
Bison won't let you declare your own token number for a non-aliased string
literal. That is, %token only understands a string literal as an alias.
Maybe this isn't worth worrying about: the user can always come up with a
dummy token name.
What do you think?
Joel