GateAI
Lexical Analysis, Parsing and SDT

GATE CSE 2015 Set 2 · Q19

MCQ1 markMedium

Time

Match the following:

GATE CSE 2015 Set 2 Q19 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) P-2, Q-4, R-1, S-3

Lexical Analysis, Parsing and SDT

Let us match each concept in the left column with its corresponding phase/technique in the right column:

  1. P. Lexical analysis →\rightarrow 2. DFA minimization: Lexical analyzers use Deterministic Finite Automata (DFAs) to recognize tokens. Minimizing DFAs produces efficient tokenizers.

  2. Q. Parsing →\rightarrow 4. Production tree: Parsing involves constructing a parse tree (or production tree) from a grammar to verify the syntax of the input string.

  3. R. Register allocation →\rightarrow 1. Graph coloring: Register allocation is mapped to the graph coloring problem (an NP-complete problem) on an interference graph to assign registers to variables.

  4. S. Expression evaluation →\rightarrow 3. Post-order traversal: Evaluating an expression represented as an abstract syntax tree / expression tree is done using post-order traversal (evaluating sub-expressions before applying the operator).

Thus, the correct matching is P-2, Q-4, R-1, S-3, which corresponds to option (C).

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 Lexical Analysis, Parsing and SDT previous year question is Q19 of the GATE CSE 2015 Set 2 paper. Find more GATE CSE PYQs on Lexical Analysis, Parsing and SDT 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 Lexical Analysis, Parsing and SDT 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.

Lexical Analysis, Parsing and SDT in GATE CSE

Lexical Analysis, Parsing and SDT has 14 GATE CSE PYQs across 12 papers from 2011 to 2025. 9 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2015 Set 2.

How GATE tests Lexical Analysis, Parsing and SDT

More from GATE CSE 2015 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2015 Set 2 · Q19 · MCQ

Match the following:

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.