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

Which of the following is the most powerful parsing method?

  1. LL (1)
  2. Canonical LR
  3. SLR
  4. LALR
asked in Compiler Design by Veteran (59.4k points) | 4.1k views

8 Answers

+10 votes
Best answer

Canonical LR is most powerful method

LR > LALR > SLR

so ans is B

 

answered by Boss (31.4k points)
edited by
+4 votes

power of PArser is derived on the basis of NO. of language parsed....

CLR could parsed all the language which could parsed by other.....

answered by Loyal (7.8k points)
+1
Power of parser is in terms of number of GRAMMARS they can parse NOT the number Of LANGUAGES.
+1
Your diagram is wrong,every LL(1) grammar is not necessarily an LALR(1)
0
every LL(1) is LALR (1) also
0
@Divyanshum29

No. Check this grammar

S --> aX | Eb | Fc

X --> Ec | Fb

E --> A

F --> A

A --> epsilon.

Its LL(1) but not LALR(1).
0
@reena

" Power of parser is in terms of number of GRAMMARS they can parse NOT the number Of LANGUAGES. "

Can u explain a bit more?
+1

@srestha LR(1) parsers can parse every language in DCFL  set because DCFL are not inherently unambiguos i.e they are gaurenteed to exist atleast one unambiguous grammar that derives them . there is one to one correspondence between the number of DCFL languages and the LR(1)( cannonical LR) parsers  but  the pther parsers SLR LALR LR(0) donot gaurentee to parse even the unambiguous versions of the grammers corresponding to the DCFL hence the power increases as SHOWN ABOVE 

0
ok :)

and what is difference in terms of grammar and in terms of language?
0
What she meant was Parser always corresponds to a grammer...for every grammer u will have a corresponding language  a language can have many grammars  but for every DCFL there is gaurenteed to exist one unambiguos one ..  we should not relate a language to the parser as it will be designed based on the grammer rules  and its not EXACTLY correct
+3 votes
Among the all parsing techniques Canonical LR i.e. CLR is MOST powerful method. We can also show the order of method in increasing power as below. LL(1) < SLR < LALR < CLR
answered by (401 points)
+2 votes
ans b)
answered by Active (5.2k points)
0 votes
CLR is more powerful.
answered by (131 points)
0 votes
CLR  is most powerful parsing method .

clr>>lalr>>slr>>ll
answered by (97 points)
0 votes
Ans: B Canonical LR
answered by Loyal (7k points)
–1 vote
answer - D
answered by Loyal (9.2k points)


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

35,527 questions
42,803 answers
121,618 comments
42,166 users