4,274 views

In the context of compilers, which of the following is/are $\text{NOT}$ an intermediate representation of the source program?

2. Abstract Syntax Tree $\text{(AST)}$
3. Control Flow Graph $\text{(CFG)}$
4. Symbol table

edited
Is it an MSQ?

Symbol table
is a data structure created and maintained by compilers in order to store info about occurrences of various entities like variable names, function names, objects, classes and interface.

Various forms of intermediate representation of code include Postfix Notation, Three address code ( x = y op z), Syntax Tree, DAG.
Abstract Syntax Tree
is a condensed version of syntax tree/parse tree more to with program than the compiler.

Parse Tree and Syntax Tree:

Control Flow Graph is used in optimization phase of compiler,each basic block consists of linear code, the next block to access is determined by the last instruction of the current block.

An Example,

     goto L2
L1:
t0 := 3 >> x
t1 := y / t0
x := t1
if y == 0 goto L3
t2 := x - 3
print t2
L3:
L2:
t4 := 4 * y
x := t4 < t5
if t5 != 0 goto L1

See:

Symbol table is not an intermediate representation

how CFG is intermediate code representation? any reference?

yes even i think, Symbol table and CFG are NOT IRs,

bcoz if you check in the textbook(ullman) chapter 8: Inermediate Code Generation, they have mentioned only about 3 types, Syntax trees and Postfix notation and 3 address codes.

ALSO they have have not even uttered a word about CFG in chapter 8

Actually in Chapter 9, i.e. Code generation , they have actually introduced the concept of Control flow graph, so it makes pretty clear that CFG is not a IR

also if you google out about CFG then you will find some webistes of foregin universities like the one i found was of cornell, with a headline “..IR and CFG”  which again makes it clear that these 2 are different and not one and the same…

plz @Arjun Sir look here and make it clear…!!!

@himanshu19, @Arjun Sir

This question was of how many marks ?
I also think , the answer was C and D.

As it is given in the Ullman

8.4 Basic Blocks and Flow Graphs

This section introduces a graph representation of intermediate code.

so OPTION D is correct.

### 1 comment

As stated above, the answer should be C and D