Question
In the context of compilers, which of the following is/are NOT an intermediate representation of the source program?
Official answer and solution
- Official answer
- D
- From
- Official GATE 2021 answer key
Solution
Differentiate between intermediate representations and data structures used during compiler passes.
An Intermediate Representation (IR) is a data structure or code representation that represents the program between the front end (analysis) and back end (synthesis) of a compiler. Common intermediate representations include:
- Linear representations, such as Three-address code (TAC), quadruples, and triples.
- Tree-based graphical representations, such as Abstract Syntax Trees (AST) and directed acyclic graphs (DAG).
- Graph-based control representations, such as Control Flow Graphs (CFG).
A Symbol Table is a helper data structure used by the compiler across multiple phases (lexical, syntax, semantic analysis, code generation) to store information about identifiers (such as type, scope, memory location). It does not represent the execution logic or operations of the source program itself, and hence is NOT an intermediate representation.
D
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 23 of 65, printed as CS Q.13
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.