The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+14 votes

Which of the following is the most powerful parsing method?

  1. LL (1)
  2. Canonical LR
  3. SLR
  4. LALR
in Compiler Design by Veteran (52.1k points) | 6.1k views
Though it's not included in the question, where would operator precedence parser fit in the terms of power ?

8 Answers

+16 votes
Best answer

Canonical LR is most powerful method


so ans is B

by Boss (30.9k points)
edited by
nice mam
+4 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
by (421 points)
+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.....

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

No. Check this grammar

S --> aX | Eb | Fc

X --> Ec | Fb

E --> A

F --> A

A --> epsilon.

Its LL(1) but not LALR(1).

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

Can u explain a bit more?

@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 

ok :)

and what is difference in terms of grammar and in terms of language?
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
+2 votes
ans b)
by Loyal (5.2k points)
0 votes
CLR is more powerful.
by (149 points)
0 votes
CLR  is most powerful parsing method .

by (133 points)
0 votes
Ans: B Canonical LR
by Loyal (7.1k points)
–1 vote
answer - D
by Loyal (8.7k 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
49,807 questions
54,729 answers
80,020 users