in Compiler Design edited by
2,379 views
0 votes
0 votes

Consider the following statements:
S1 : Three-address code is a linearized representation of syntax tree.
S2 : The syntax tree not depicts the natural hierarchical structure of source program.
Which of the following is true?

plz explain s1 statement

in Compiler Design edited by
by
2.4k views

3 Comments

S1 and S2 can be found:-  https://www.cse.iitk.ac.in/users/karkare/cs335/lectures/15IR_and_SymTab.pdf 

page number 15 AND 11.

 

0
0
url not working
0
0

2 Answers

1 vote
1 vote

Three-address code is a linearized representation of syntax tree.

Suppose we have a parse tree with + as root node and a and b as child nodes. Then, the three address code would be represented as,

      op  op1 op2  result
(1)   +   a     b     t1

2 Comments

can you give me any example of non linearized representation actually little bit dbt in my mind
0
0
Syntax tree is one such representation.
1
1
0 votes
0 votes

S1 is true: Three-address code is a linearized representation of syntax tree. Because we can determine the three address code from syntax tree. 

From my notes

S2 is false:  The syntax tree depicts the natural hierarchical structure of source program.because if statement(arithmetic) gives in the linear form then we are able to make a hierarchical structure of syntax tree. From my notes