bug-bison
[Top][All Lists]
Advanced

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

Re: [PATCH] Do not allow identifiers that start with a negative number.


From: Akim Demaille
Subject: Re: [PATCH] Do not allow identifiers that start with a negative number.
Date: Wed, 26 Jan 2011 17:19:29 +0100

Le 15 janv. 2011 à 22:50, Joel E. Denny a écrit :

1.
>  An identifier can be any sequence of letters, underscores, periods, 
>  dashes, and digits that does not start with an integer (unsigned or 
>  negative).
2.
>  An identifier can be any sequence of letters, underscores, periods, 
>  dashes, and digits that does not start with an integer or float 
>  (unsigned or negative).
3.
>  An identifier can be any sequence of letters, underscores, periods, 
>  dashes, and digits that does not start with a digit or dash.

I dislike 2, and like 1 and 3 equally.

Let me go a bit further about this.  I have always wished I could use *, ?, and 
+ in my names.  SDF has this approach that foo? is actually a single 
identifier, and there's a pass on "missing" symbols that defines them (so here 
it would add foo?: \* empty */ | foo;).

Eventually, I would really like if we could add a bit of EBNF in our notation.  
Of course for SDF it easier, as they don't have to obey user actions and types 
(given the type of foo, what would Bison use for foo*, foo?, foo?, (foo|bar) 
etc.?).  But AFAIR, Menhir solved that issue.

I'm not saying we should deal with that, just that it might help us to think 
about what we might want to do with our symbols in the future.




reply via email to

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