edited by
2,354 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

edited by

2 Answers

1 votes
1 votes

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

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

Related questions

0 votes
0 votes
1 answer
1
Nikhil Patil asked Feb 18, 2018
532 views
$\text{What is three address code representation of this ?}$-a+b|c^d^e*f|g
1 votes
1 votes
1 answer
2
Nihal Singh asked Oct 4, 2021
1,433 views
Hi Everyone,For this the Given Answer is 5, I got 4. I am now confused about how the 3 address code is generated here.
0 votes
0 votes
1 answer
3
thor asked Nov 17, 2016
1,065 views