Question:

Which one of the following statements is TRUE?

Show Hint

LR(1) parsing is powerful enough to handle deterministic context-free languages and is widely used in efficient compiler construction.
Updated On: Jan 11, 2026
  • The LALR(1) parser for a grammar G cannot have reduce-reduce conflict if the LR(1) parser for G does not have reduce-reduce conflict.
  • Symbol table is accessed only during the lexical analysis phase.
  • Data flow analysis is necessary for run-time memory management.
  • LR(1) parsing is sufficient for deterministic context-free languages.
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

- Option (A) is false. The LALR(1) parser can still have a reduce-reduce conflict even if the LR(1) parser does not, because LALR(1) is a simplification of LR(1) and may introduce conflicts due to merging of states. Thus, this option is incorrect.

- Option (B) is false. The symbol table is typically accessed during both the lexical analysis and the semantic analysis phases, not just during lexical analysis. In fact, it is used throughout the compilation process, particularly during syntax and semantic analysis.

- Option (C) is false. Data flow analysis is not directly related to run-time memory management, but rather to analyzing how data is propagated throughout a program. It helps detect errors and optimize code but does not deal with memory allocation or management directly.

- Option (D) is true. LR(1) parsing is indeed sufficient for deterministic context-free languages, which are those that can be parsed deterministically using a single lookahead symbol. LR(1) parsers can handle a broader class of languages compared to LL(1) parsers. This is the correct statement.

Final Answer: (D)
Was this answer helpful?
0
0

Top Questions on Parsing