The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
109 views
$L=\{x^n:n \in N\} \cup\{x^ny^n|n \in N\}$

This language does not have LL(k) parser while being deterministic context free.Why?
in Compiler Design by Boss (26k points) | 109 views
0
is this DCFL ?
0
yes. If we assume end delimiter is there. i.e., all strings end with a delimiter like '$'.
0

If we assume end delimiter is there

then it is DCFL, in that case it should have LL(k) for some k

right sir ?

then there is no meaning in this question !

+2
No. DCFL is guaranteed to have only LR(1) not necessarily LL(k)
0

if it is LL(k) for some k, then it is LR(m) for some m. but converse not true !

Forgot that basic point, thanks sir !!

+1

@Arjun sir and  @Shaik Masthan-I am trying to build a proof  point out if anywhere I go wrong.

The grammar can be

$S->A|B\\A->xA|x\\B->xBy|xy$

For string let's say $w_1=x^3$ we need to use production $S->A$ and for string $w_2=x^3y^3$ we need to use the production $S->B$

So here we are in a dilemma which one to use.

Similarly, for a given string of length say $n$, we are not sure how much of lookahead we need for each string so that production to be used at each step can be uniquely determined.

So, the given language does not have an LL(K) parser for any fixed k.

Am I going in the correct direction?

0
yes, intuitively that is correct ? Similar to why LR(k) is more powerful than LL(k).
0
sir, can you show in formal way, why it doesn't have any LL(k) parser?
+1

1 Answer

0 votes

Till DCFL there exist a LR(K) parser.

by Boss (34.6k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,093 questions
55,328 answers
190,852 comments
86,255 users