GATE CS 2022 | Question 13
Compiler Design › Parser · MCQ · 1 mark · Answer: D
- Question 13Compiler Designmcq1 markWhich one of the following statements is TRUE?
- A.The LALR(1) parser for G cannot have a reduce-reduce conflict if the LR(1) parser for G does not have a reduce-reduce conflict.
- B.Symbol table is accessed only during the lexical analysis phase.
- C.Data flow analysis is necessary for run-time memory management.
- D.LR(1) parsing is sufficient for deterministic context-free languages.✓
Answer: D
Solution
Answer: (D) Every deterministic context-free language has an LR(1) grammar, so LR(1) parsing suffices for DCFLs -> (D) true. (A) is false: merging LR(1) states in LALR(1) can introduce reduce-reduce conflicts even when LR(1) has none. (B) false (symbol table used across many phases). (C) false (data-flow analysis is for optimization, not run-time memory management). - A.
More GATE PYQ on Parser
All GATE CS Compiler Design PYQ →Attempt GATE CS 2022 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →