The Gateway to Computer Science Excellence
+16 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 | 8.6k views
Though it's not included in the question, where would operator precedence parser fit in the terms of power ?

8 Answers

+23 votes
Best answer

Canonical LR is most powerful method


so ans is B

by Boss
edited by
nice mam
+5 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
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
+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
+2 votes
ans b)
by Active
0 votes
CLR is more powerful.
0 votes
CLR  is most powerful parsing method .

0 votes
Ans: B Canonical LR
by Loyal
–1 vote
answer - D
by Loyal

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
52,223 questions
59,811 answers
118,087 users