Skip to content
Official PYQ · 2001

GATE CS 2001 Q1.18 — Parsing (LL, LR)

Explain with AI

Which of the following statements is false?

Choose one option
View worked solution

Answer: A

To find the false statement, let's analyze each option:

  • Option A: An unambiguous grammar guarantees that every valid string has a unique leftmost derivation (LMD) and a unique rightmost derivation (RMD). However, the LMD and RMD themselves are generally different sequences of derivation steps. For example, for the unambiguous grammar S→ABS \to AB, A→aA \to a, B→bB \to b, the LMD is S⇒AB⇒aB⇒abS \Rightarrow AB \Rightarrow aB \Rightarrow ab, while the RMD is S⇒AB⇒Ab⇒abS \Rightarrow AB \Rightarrow Ab \Rightarrow ab. Since these derivations are different, this statement is false.
  • Option B: LL(1) is a predictive top-down parsing technique. This statement is true.
  • Option C: LALR(1) uses lookahead propagation to resolve conflicts that SLR(1) cannot, making LALR strictly more powerful than SLR. This statement is true.
  • Option D: Every LR(k) grammar is deterministic and therefore must be unambiguous. Thus, an ambiguous grammar can never be LR(k) for any kk. This statement is true.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Parsing (LL, LR) questions