All Exams Test series for 1 year @ ₹349 only
Question

Consider the following statements:

Statement I: LALR parser is more powerful than canonical LR Parser.

Statement II: SLR parser is more powerful than LALR

Which of the following is correct?

The correct answer is

Both Statement I and Statement II false

The grammar-recognition power is SLR(1) ⊂ LALR(1) ⊂ canonical LR(1). Canonical LR retains full lookahead context, while LALR merges states and SLR uses coarser FOLLOW sets. Both claimed reverse orderings are false.

Was this answer helpful?

Important Questions from Parser

  1. Arrange the following parsers in increasing order of their power of handling grammars i.e. from the least powerful parser to the most powerful parser.
    A. LR(0)
    B. LR(1)
    C. LALR(1)
    D. LL(0)
    E. SLR
    Choose the correct answer from the options given below:
  2. Which of the following statements is/are true?
  3. Given below are two statements

    Statement I : LL(1) and LR are examples of Bottom‐up parsers.

    Statement II : Recursive descent parser and SLR are examples of Top‐down parsers

    In light of the above statements, choose the correct answer from the options given below

  4. Consider the grammar G with productions \(S\to A\mid B,\quad A\to a\mid c,\quad B\to b\mid c\). The nonterminals are S, A, B and the terminals are a, b, c.

    Without rewriting G or resolving parsing-table conflicts by an extra rule, which statements are correct?

    S1: The canonical LR(1) parsing table for G is conflict-free.

    S2: The LL(1) predictive parsing table for G is conflict-free.

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App