Institutt for Informatikk
Universitetet i Bergen
INF 225  Innføring i Programoversettelse  H05
Voluntary Exercise Set 9 (Group meeting 18.11.2005)

Exercise 7.16 on page 394 of the text.

Consider the following C expression:
a * b + (5  (1 + 2))

Draw an appropriate AST for the expression,
preferably one that your parser would produce.

Give a sequence of threeaddress instructions corresponding
to the expression and AST.

Give a sequence of Pcode instructions corresponding
to the expression and AST.

Give a sequence of
BVM
instructions corresponding to the expression and AST.

Consider the following C expression:
a[a[i+10]] = b[2+3]

Draw an appropriate AST for the expression,
preferably one that your parser would produce.

Give a sequence of threeaddress instructions corresponding
to the expression and AST.

Give a sequence of Pcode instructions corresponding
to the expression and AST.

Give a sequence of
BVM
instructions corresponding to the expression and AST.

Consider the following C expression:
p>next>next = p>next

Give a sequence of threeaddress instructions corresponding
to the expression.

Give a sequence of Pcode instructions corresponding
to the expression.

Give a sequence of
BVM
instructions corresponding to the expression.