Which statement is true?

2015

Which statement is true?

  1. A.

    LALR parser is more powerful and costly as compare to other parsers

  2. B.

    All CFG\'s are LP and not all grammars are uniquely defined

  3. C.

    Every SLR grammar is unambiguous but not every unambiguous grammar is SLR

  4. D.

    LR(K) is the most general back tracking shift reduce parsing method

Attempted by 87 students.

Show answer & explanation

Correct answer: C

The correct statement is that every SLR grammar is unambiguous, but not every unambiguous grammar is an SLR grammar. This means the class of SLR grammars is a proper subset of unambiguous grammars. LR(K) parsers are deterministic shift-reduce methods, not backtracking ones. Additionally, LALR grammars do not have greater power than LR(1) grammars.

Explore the full course: Isro