Skip to content
GATEiit

GATE CSE 2017 Session 2 Q16: Relative power of canonical LR, SLR and LALR parsers

Syllabus topic: Lexical analysis, parsing and syntax-directed translation

Question

Which of the following statements about parser is/are CORRECT?

I. Canonical LR is more powerful than SLR. II. SLR is more powerful than LALR. III. SLR is more powerful than Canonical LR.

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation

Answer: A (official GATE 2017 final answer key)

Concept used: The bottom-up parser hierarchy is SLR(1) ⊂ LALR(1) ⊂ canonical LR(1) in the grammars they accept.

Concept notes

Loading notes…

First step: Recall the containment order of grammars accepted by SLR, LALR and CLR parsers.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Lexical analysis, parsing and syntax-directed translation

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2017 Session 2 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key