|[21 earlier articles]|
|Re: Programming language and IDE design firstname.lastname@example.org (Jonathan Thornburg) (2013-11-19)|
|Re: Programming language and IDE design email@example.com (2013-11-22)|
|Re: Programming language and IDE design firstname.lastname@example.org (robin) (2013-11-25)|
|Re: Programming language and IDE design email@example.com (Martin Ward) (2013-12-03)|
|Re: Programming language and IDE design DrDiettrich1@aol.com (Hans-Peter Diettrich) (2013-12-05)|
|Re: Programming language and IDE design firstname.lastname@example.org (2014-03-02)|
|Re: Programming language and IDE design email@example.com (George Neuner) (2014-03-02)|
|From:||George Neuner <firstname.lastname@example.org>|
|Date:||Sun, 02 Mar 2014 12:21:01 -0500|
|Organization:||A noiseless patient Spider|
|References:||13-11-016 13-11-018 14-03-003|
|Posted-Date:||03 Mar 2014 06:26:15 EST|
On Sun, 2 Mar 2014 00:03:18 +0000 (UTC), email@example.com
>I don't think C++ is LL(2).
>(Example from n3485, page 131).
>The former is a statement, while the latter is a declaration, and you
>can decide this only very late. As the first four tokens are the same,
>C++ can't be LL(4), at least.
>As you can substitute '('^n x ')' ^n for a in this example (i.e. enclose
>that identifier in any number of parentheses), C++ isn't LL(n) for any n.
>(In the first case, "a" is a subexpression, that can be parenthesized,
>while in the second case, it's the declarator-id that can also be
I suppose that it depends on your definitions: a "syntax" token is
different from a "grammar" token ... a single grammar token can
represent an expression of any complexity. I think the whole notion
of lookahead is ambiguously level dependent.
But I concede your point re: syntax.
>So the C grammar is not LL(k) for any k, either. You can probably parse
>that particular part of the C/C++ grammar easily using LR.
However, both C and C++ are LL(*). LL(*) Antlr-3 grammars are
available for both http://www.antlr3.org/grammar/list.html
Also in that list you'll find an LL(k) Antlr-2 grammar for C/C++ which
at quick glance claims to be LL(2) ... but I haven't examined it to
know what tricks it may be employing.
Return to the
Search the comp.compilers archives again.