...
GATE 1993
October 28, 2023
Nature-of-Teaching
October 28, 2023
GATE 1993
October 28, 2023
Nature-of-Teaching
October 28, 2023

GATE 2021 CS-Set-2

Question 33
 In the context of compilers, which of the following is/are NOT an intermediate representation of the source program?
A
Three address code
B
Abstract Syntax Tree (AST)
C
Symbol table
D
Control Flow Graph (CFG)
Question 33 Explanation: 
  • An intermediate representation is a representation of a program “between” the source and target languages. A good IR is one that is fairly independent of the source and target languages, so that it maximizes its ability to be used in a retargetable compiler.

    Types of intermediate representation:

    1. Structured (Tree such as abstract syntax tree or Graph such as CFG, single static assignment)
    2.  tuple-based, generally three-address code (quadruples)

     

    Symbol table is not an intermediate representation of a source program. Symbol table is created in the first phase (lexical analysis phase and subsequently updated in later phases) and it stores the information about the occurrence of various entities such as variable names, function names, objects, classes, interfaces, etc.

     

    Abstract syntax tree and three address code are well known representations of intermediate code.

    CFG i.e., control flow graph is also a representation of intermediate code which represents the flow of control of the program. In CFG we break sequences of three address codes into basic blocks hence CFG is also a representation of intermediate code as it contains three address codes along with control flow representation with help of blocks and edges (arrows).

Correct Answer: C
Question 33 Explanation: 
  • An intermediate representation is a representation of a program “between” the source and target languages. A good IR is one that is fairly independent of the source and target languages, so that it maximizes its ability to be used in a retargetable compiler.

    Types of intermediate representation:

    1. Structured (Tree such as abstract syntax tree or Graph such as CFG, single static assignment)
    2.  tuple-based, generally three-address code (quadruples)

     

    Symbol table is not an intermediate representation of a source program. Symbol table is created in the first phase (lexical analysis phase and subsequently updated in later phases) and it stores the information about the occurrence of various entities such as variable names, function names, objects, classes, interfaces, etc.

     

    Abstract syntax tree and three address code are well known representations of intermediate code.

    CFG i.e., control flow graph is also a representation of intermediate code which represents the flow of control of the program. In CFG we break sequences of three address codes into basic blocks hence CFG is also a representation of intermediate code as it contains three address codes along with control flow representation with help of blocks and edges (arrows).

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!