The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+6 votes
2.3k views

Which statement is true?

  1. LALR parser is more powerful and costly as compare to other parsers
  2. All CFG's are LP and not all grammars are uniquely defined
  3. Every SLR grammar is unambiguous but not every unambiguous grammar is SLR
  4. LR(K) is the most general back tracking shift reduce parsing method
asked in Compiler Design by Veteran (103k points)
edited by | 2.3k views

2 Answers

+8 votes
Best answer

Answer : C

A . Most powerful and costly order is

     LR(0) < SLR(1) < LALR(1) < CLR(1)

B . The grammar generated by LP are CFG but not implying All CFG are LP.

C . Every SLR grammar is unambiguous but not every unambiguous grammar is SLR 

D . LR(k) is the most general non back tracking shift reduce parsing method 

answered by Boss (45.3k points)
selected by
0
what kind of mistake in C option ?
0
I have seen the official paper of isro in which option c is

Every SLR grammar is unambiguous but not every unambiguous grammar is SLR
0
Ok that's fines then how you come to conclusion that option B is correct.
0
I did not understand the meaning of LP that why i left the option without exploring .because all others are wrong .
+1
Ya LP here is  Linear precedence rule.

The grammar generated by LP are CFG but not implying All CFG are LP.
0
so it makes all the option B also wrong .then there must be a correction in option c and the answer would be C
0
yes
0
what is LP?
0
0 votes
Option C will be right option.

According to more error capability along with cost order of different types of parser is given.

CLR(1)>LALR(1)>SLR(1)>LR(0)

But according to number of state .

n4>=n3=n2=n1

There is no property of non back tracking shift reduce in any parser.

So only option C will be right option bcz only operator precedence grammar will act with amgiguos grammar and all grammar act with unambiguos grammar along not all unambiguos grammar will be SLR(1).

So option C will be right.
answered by Loyal (9k points)
0
what do you mean by  n4,n3,n2,n1  clearly specify naaa


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

40,805 questions
47,492 answers
145,713 comments
62,249 users