Which of the following statements is false?
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 , , , the LMD is , while the RMD is . 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 . This statement is true.
Free practice · Your answers on this page are not saved.
