GATE / CS ARCHIVE

GATE CSE 2021 SET 2 / QUESTION 13

GATE CSE 2021 Set 2 Q13

Compiler Design · Intermediate Code · Full GATE CSE 2021 Set 2 paper

GATE 2021 Set 2, Q13 1 mark · MSQ
Report issue

Intermediate Code

Question 13, GATE 2021: Which is NOT an intermediate representation of source computation? A three-address code; B abstract syntax tree; C control-flow graph; D symbol table. Multiple selections are permitted.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: D

Three-address code, an abstract syntax tree, and a control-flow graph represent program computations or structure. A symbol table instead records information about names, types, scopes, and bindings. It supports analysis but is not an intermediate representation of the source computation. Thus D.

For an assignment x=a+b, three-address code records the operation, an AST records its expression structure, and a CFG records possible control transfers around it. The symbol table instead stores facts such as x's declared type or scope. A compiler may use all four structures; “used by a compiler” is broader than “intermediate representation.”

Original paper, page 62 · Answer key