GateAI
Intermediate Code Generation

GATE CSE 2015 Set 2 · Q14

MCQ1 markMedium

Time

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is TRUE?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: See verified solution

Intermediate Code Generation

Let us analyze the given statements regarding AST and CFG:

  • Option A is False: In a CFG, backward edges (such as in loops or backwards goto jumps) can lead from a node N1N_1 to a successor N2N_2 whose corresponding code appears earlier in the program text.

  • Option B is False: A CFG will contain cycles whenever the input program contains loops or recursive flow constructs.

  • Option C: The number of successors of a node in an AST depends on the construct (for instance, an nn-ary operator or a statement list) and in a CFG depends on branching constructs (such as a multi-way switch statement), which vary with the input program. However, under certain restricted standard definitions of AST/CFG, this phrasing was deemed ambiguous, and this question was marked as Marks to All (MTA) in the official GATE key.

  • Option D is False: A basic block in a CFG typically comprises a sequence of multiple consecutive three-address code statements, not at most one.

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 Intermediate Code Generation previous year question is Q14 of the GATE CSE 2015 Set 2 paper. Find more GATE CSE PYQs on Intermediate Code Generation 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 Intermediate Code Generation 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.

Intermediate Code Generation in GATE CSE

Intermediate Code Generation has 14 GATE CSE PYQs across 12 papers from 2011 to 2025. 5 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2015 Set 2.

How GATE tests Intermediate Code Generation

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 · Q14 · MCQ

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following 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.