Le 17 avr. 09 à 05:59, Joel E. Denny a écrit :
On Wed, 15 Apr 2009, Akim Demaille wrote:
I don't like too much this approach, I prefer simply welcoming
dashes in the
set of letters that can compose symbol names. Of course we would
have to have
warnings and errors in Yacc mode, but that should not be hard, we
certainly
have one well defined point by which we always pass to make a
symbol name. I
also like that identifiers and directives are only separated by %.
But what do others think?
What about tokens and the union name? These can't have dashes. Do
we let
the compiler catch that, or should Bison?
Interesting question. For the union, currently dots are allowed and
not reported by Bison, leaving this task to the compiler.
%token accepts periods, but only C-identifiers are output in the
parser file.
a...@montero /tmp $ cat foo.y
%token foo.bar
%token foo_bar
%%
exp: foo_bar foo.bar;
a...@montero /tmp $ grep foo.bar foo.tab.c
foo_bar = 259
"$end", "error", "$undefined", "foo.bar", "foo_bar", "$accept",
"exp", 0
We could continue like this.
So do you agree with this patch?
(Is there a significant difference between "dot" and "period"?
Internet search is not really helping here.)