in Compiler Design
10,501 views
0 votes
0 votes

Translate the arithmetic expression $a + -(b + c)$ into:

  1. A syntax tree.
  2. Quadruples.
  3. Triples.
  4. Indirect triples
in Compiler Design
10.5k views

1 comment

Iā€™m confused regarding the direction of arrows. In some books they are pointing downwards while in this question I observed that arrows are pointing upwards. Someone please clarify my doubt.
0
0

1 Answer

5 votes
5 votes

Syntax Tree

Quadruples

  operator Argument1 Argument2 Result
0 + b c t1
1 unary minus t1   t2
2 + a t2 t3

Triples

  operator Argument1 Argument2
0 + b c
1 unary minus (0)  
2 + a (1)

Indirect Triples

0 (0)
1 (1)
2 (2)

 

Related questions