Institutt for Informatikk
Universitetet i Bergen
I 225 - Innføring i Programoversettelse - H04
Voluntary Exercise Set 10 (Group meeting 22.11.2004)
-
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 three-address instructions corresponding
to the expression and AST.
-
Give a sequence of P-code 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 three-address instructions corresponding
to the expression and AST.
-
Give a sequence of P-code 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 three-address instructions corresponding
to the expression.
-
Give a sequence of P-code instructions corresponding
to the expression.
-
Give a sequence of
BVM
instructions corresponding to the expression.