• retagged by
4,425 views

2 Answers

Best answer
15 15 votes

Yes LR(k) is generalisation and extension of LL(k) [top down parsers]..

And yes there is one to one correspondence between LR(k) grammar and DCFL class of languages..

In fact , for every DCFL , we have at least one of LR(1) or LR(0) grammar -- does not mean that any grammar for a DCFL is LR(1)

But if a DCFL is having prefix property ( meaning that no string of a given language is a prefix of other string of the same language ) , then that DCFL is guaranteed to have LR(0) grammar..

But all DCFLs need not have LL grammar..

Reference : Peter Linz chapter on deterministic context free languages and grammars (Chapter 7)

• edited by
0 0 votes

Answer is No. 

Bcoz every every Regular language is also a deterministic CFL not the other way round.

Now regula language is based on regular grammar which can be both left linear and right linear.

When a grammar is both Left recursive and right recusive, it is called ambiguous grammar.

Now the only bottom up parser which can accept ambiguous grammar is Operator precedence parser. 

LR parsers cannot accept accept ambiguous grammars.

Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
585
585 views
learner_geek asked Aug 2, 2017
585 views
is this given diagram correct or incorrect if incorrect then please correct it .
0 0 votes
1 answers 1 answer
1.9k
1.9k views
Shyam Singh 1 asked Dec 10, 2016
1,884 views
Every SLR grammar is unambiguous. True or False? Why?
1 1 vote
1 1 answer
581
581 views
vaishali jhalani asked Nov 21, 2016
581 views
Consider the following statements:S1: Whenever we apply transition on any symbol the lookahead does not changeS2: The lookahead has effect on items of the form[A → α. β, ...
1 1 vote
4 answers 4 answers
4.8k
4.8k views
Rahul_Rathod_ asked Jan 21, 2019
4,826 views
grammar is CLR(1) or not?if yes then how?