Re: An example LL(K) language that is not LL(K-1) ?

Kaz Kylheku <kkylheku@gmail.com>
Wed, 3 Feb 2010 18:18:56 +0000 (UTC)

          From comp.compilers

Related articles
An example LL(K) language that is not LL(K-1) ? klyjikoo@gmail.com (klyjikoo) (2010-01-26)
Re: An example LL(K) language that is not LL(K-1) ? haberg_20080406@math.su.se (Hans Aberg) (2010-01-28)
An example LL(K) language that is not LL(K-1) ? chakaram@auth.gr (Chariton Karamitas) (2010-02-01)
Re: An example LL(K) language that is not LL(K-1) ? klyjikoo@gmail.com (klyjikoo) (2010-02-02)
Re: An example LL(K) language that is not LL(K-1) ? cfc@shell01.TheWorld.com (Chris F Clark) (2010-02-03)
Re: An example LL(K) language that is not LL(K-1) ? kkylheku@gmail.com (Kaz Kylheku) (2010-02-03)
Re: An example LL(K) language that is not LL(K-1) ? daniel.eliason@excite.com (fortunatus) (2010-02-04)
Re: An example LL(K) language that is not LL(K-1) ? slkpg@cox.net (SLK Mail) (2010-02-05)
Re: An example LL(K) language that is not LL(K-1) ? cfc@shell01.TheWorld.com (Chris F Clark) (2010-02-05)
Re: An example LL(K) language that is not LL(K-1) ? kkylheku@gmail.com (Kaz Kylheku) (2010-02-06)
Re: An example LL(K) language that is not LL(K-1) ? klyjikoo@gmail.com (klyjikoo) (2010-02-06)
Re: An example LL(K) language that is not LL(K-1) ? slkpg@cox.net (SLK Mail) (2010-02-06)
[4 later articles]
| List of all articles for this month |

From: Kaz Kylheku <kkylheku@gmail.com>
Newsgroups: comp.compilers
Date: Wed, 3 Feb 2010 18:18:56 +0000 (UTC)
Organization: A noiseless patient Spider
References: 10-02-009 10-02-015
Keywords: LL(1)
Posted-Date: 05 Feb 2010 17:32:14 EST

On 2010-02-02, klyjikoo <klyjikoo@gmail.com> wrote:
>
>> I don't think your assumption that any LL(k) can be transformed into
>> an LL(k-1) is correct. The 'k' in LL(k) is assumed to be the supremum
>> of lookahead symbols that you need in order to parse your input. So,
>> suppose you have an LL(2) grammar, then you cannot convert it to an
>> LL(1) since the LL(1) equivalent won't have disjoint FIRST/FOLLOW sets!
>
>> I am not yet very experienced when it comes to compilers, so, if my
>> answer is wrong correct me please! :-)n
>
> Thanks to Hans, Consider this example :
>
> 1) Z := X
> 2) X := Y
> 3) X := bYa
> 4) Y := c
> 5) Y := ca


This grammar generates only a finite set of strings. So it gives a
regular language, which can be described by the regular expression
(cca|bca|bcaa).


It would be astonishing if a regular language could not be described by
a LL(1) grammar.


:)



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.