Compilers Questions and Answers – Error Recovery in LR phase – 2

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Error Recovery in LR phase – 2”.

1. The grammar S → aSa | bS | c is?
a) LL(1) but not LR(1)
b) LR(1) but not LR(1)
c) Both LL(1) but not LR(1) & LR(1) but not LR(1)
d) None of the mentioned
View Answer

Answer: c
Explanation:
First(aSa) = a
First(bS) = b
First(c) = c
LR parsers are more powerful than LL (1) parsers and LR (1).

2. Recursive descent parsing is an example of ____________
a) Top down parsing
b) Bottom up parsing
c) Predictive parsing
d) None of the mentioned
View Answer

Answer: a
Explanation: Top down is the answer.

3. LR stands for ___________
a) Left to right
b) Left to right reduction
c) Right to left
d) Right most derivation and Left to right and a in reverse
View Answer

Answer: d
Explanation: Right most derivation and left to right and in reverse is used for LR.
advertisement
advertisement

4. Which is the most powerful parser?
a) SLR
b) LALR
c) Canonical LR
d) Operator-precedence
View Answer

Answer: c
Explanation: Canonical tops all other parsers.

Sanfoundry Global Education & Learning Series – Compilers.

Note: Join free Sanfoundry classes at Telegram or Youtube

To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.