From: | fortunatus <daniel.eliason@excite.com> |
Newsgroups: | comp.compilers |
Date: | Thu, 4 Feb 2010 09:22:51 -0800 (PST) |
Organization: | Compilers Central |
References: | 10-02-009 10-02-015 |
Keywords: | LL(1) |
Posted-Date: | 05 Feb 2010 17:32:32 EST |
On Feb 2, 6:57 am, klyjikoo <klyji...@gmail.com> wrote:
>
> Thanks to Hans, Consider this example :
You have indeed offered an example of and LL(2) grammar that is
equivalent to an LL(1) grammar.
However both grammars (if the derivation is correct) accept the same
language.
So that language could be said to be LL(1), in that only an LL(1)
grammar is required to generate it. One would not say that the
language is LL(2), even though it is possible to write an LL(2)
grammar to generate it.
As Hans has suggested, a truly LL(2) language would have an LL(2)
grammer that could not be reduced to an LL(1) grammar.
(As an analogy: it is possible to write a CFG to generate a Regular
language. In that case the CFG could be converted to an RE. The CFG
just would not have any important recursions that produce anything
more complex than simple repitition.)
Return to the
comp.compilers page.
Search the
comp.compilers archives again.