StreakPeaked· Practice

ExamsGATETechnical

Which one of the following statements is TRUE?

  1. 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.
  2. Symbol table is accessed only during the lexical analysis phase.
  3. Data flow analysis is necessary for run-time memory management.
  4. LR(1) parsing is sufficient for deterministic context-free languages.

Correct answer: LR(1) parsing is sufficient for deterministic context-free languages.

Solution

LR(1) parsing is designed to handle deterministic context-free languages by using a lookahead symbol to make parsing decisions, ensuring that it can resolve ambiguities and conflicts that may arise in the parsing process.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →