6,508 views

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

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

### 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.

Syntax Tree

 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)

by