GateAI
Parsing

GATE CSE 2022 · Q13

MCQ1 markMedium

Time

Which one of the following statements is TRUE?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

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

Parsing

Let us analyze each statement:

  • (A) is FALSE: Merging states with identical sets of items (cores) when constructing an LALR(1)\text{LALR}(1) parser from an LR(1)\text{LR}(1) parser never creates shift-reduce conflicts, but it can introduce reduce-reduce conflicts.

  • (B) is FALSE: The symbol table is created/populated during lexical analysis and accessed/modified throughout multiple subsequent phases of the compiler (syntax analysis, semantic analysis, intermediate code generation, optimization, and code generation).

  • (C) is FALSE: Data flow analysis is a static technique used during compile-time for code optimization (e.g., liveness analysis, reaching definitions, constant propagation), not for run-time memory management.

  • (D) is TRUE: The class of languages accepted by deterministic pushdown automata (DPDAs) is precisely the class of Deterministic Context-Free Languages (DCFLs). Every DCFL can be generated by an LR(1)\text{LR}(1) grammar, meaning LR(1)\text{LR}(1) parsing is sufficient for all DCFLs.

Thus, option (D) is the only TRUE statement.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Parsing previous year question is Q13 of the GATE CSE 2022 paper. Find more GATE CSE PYQs on Parsing in Compiler Design, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Parsing PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Parsing in GATE CSE

Parsing has 23 GATE CSE PYQs across 16 papers from 2012 to 2026. 5 of them are 1-mark MCQs like this one, and GATE CSE 2022 has 2.

How GATE tests Parsing

More from GATE CSE 2022

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2022 · Q13 · MCQ

Which one of the following statements is TRUE?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.