This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Meeting Agenda 2008-08-27
>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> writes:
Sami> ie the lexer will create tokens NAME COLONCOLON NAME, and not specify
Sami> that name is a TYPENAME or a symbol NAME. Then in the parser have a
Sami> rule like this
Just a bit of background here...
In C this lexer trick is called the "typedef hack". Basically the C
grammar is ambiguous. E.g., consider:
(x) -y
If x is a typedef, then this is a cast of a unary negation.
If x is a variable, then this is a subtraction.
So, it became common practice in C to check names while lexing.
There are various options for fixing this... but just removing this
hack from the lexer is not enough.
Tom