Skip to content
Official PYQ · 2022

GATE CS 2022 Q3 — Parsing (LL, LR)

Explain with AI

Which one of the following statements is TRUE?\text{TRUE}?

Choose one option
View worked solution

Answer: D

Let us analyze each statement to determine its correctness:

  • Option A is FALSE: When merging states with the same core to construct an LALR(1)\textit{LALR}(1) parser from an LR(1)\textit{LR}(1) parser, the combination of lookaheads can introduce new reduce-reduce conflicts, even if the original LR(1)\textit{LR}(1) parser had none.
  • Option B is FALSE: The symbol table is a central data structure accessed and updated across almost all phases of a compiler, including semantic analysis, intermediate code generation, and code optimization.
  • Option C is FALSE: Data flow analysis is used for compile-time code optimizations (such as liveness analysis and constant propagation), not for run-time memory management.
  • Option D is TRUE: The class of languages that can be parsed by an LR(1)\textit{LR}(1) parser is precisely the class of Deterministic Context-Free Languages (DCFLs). Therefore, LR(1)\textit{LR}(1) parsing is sufficient for any DCFL.

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

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