|Re: Is C++ LL(k)? email@example.com (Lin Gu) (2001-07-23)|
|Re: Is C++ LL(k)? firstname.lastname@example.org (2001-07-27)|
|Re: Is C++ LL(k)? email@example.com (Mike Dimmick) (2001-07-27)|
|Re: Is C++ LL(k)? firstname.lastname@example.org (2001-08-06)|
|From:||email@example.com (Kaz Kylheku)|
|Date:||27 Jul 2001 02:50:11 -0400|
|Organization:||Psycho-Neurotic Institute for the Very, Very Nervous|
|References:||<firstname.lastname@example.org> <mSZ67.email@example.com> 01-07-138|
|Posted-Date:||27 Jul 2001 02:50:11 EDT|
>Thanks for the clear elumination.
>Your example also reminds me the 'if...if...else' ambiguation. Surely it is
>However, I may have to use an LL(k) compiler generator (Antlr) to
>write a compiler for it. Is it difficult? It is expected that I need
>to add some rules to disambiguate, but I want to know whether this is
You can add fake nonterminals to disambiguate as well. I don't have
experience writing a C++ parser, but in a C parser you can, for instance,
deal with typedef names by inventing a ``fake'' lexical category of
non-terminals called ``typename''. Have the lexical analyzer consult
the symbol table and then assign that category to an identifier that is
found to be a typedef name, rather than the category ``identifier''.
See the newsgroup comp.compilers; it may seem surprising, but
comp.lang.c++ isn't really for discussing parsing techniques for C++!
Return to the
Search the comp.compilers archives again.