11,125 views
0 votes
0 votes

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

  1. A syntax tree.
  2. Quadruples.
  3. Triples.
  4. Indirect triples

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

0 votes
0 votes
1 answer
1
admin asked Sep 7, 2019
1,703 views
Show how to transform a three-address code sequence into one in which each defined variable gets a unique variable name.
1 votes
1 votes
1 answer
2
admin asked Sep 7, 2019
8,082 views
Translate the following arithmetic expression into:$a=b[i]+c[j]$$a[i]=b\ast c-b\ast d$$x=f(y+1)+2$$x=\ast p + \&y$ A Syntax treeQuadruplesTriplesIndirect triples
0 votes
0 votes
0 answers
4
admin asked Sep 7, 2019
591 views
Add to the translation of Fig. $6.19$ rules for the following productions:$E\rightarrow E_{1}\ast E_{2}$$E\rightarrow + E_{1}\:$(unary plus)