Data
structures for representation of TAC can be objects or records with fields for operator
and operands. Representations include quadruples, triples and indirect triples.
Quadruples
•
In the quadruple representation, there are four fields for each instruction: op,
arg1, arg2, result
– Binary ops have the
obvious representation
– Unary ops don’t use
arg2
– Operators like
param don’t use either arg2 or result
– Jumps put the
target label into result
•
The quadruples in Fig (b) implement the three-address code in (a) for the
expression
a = b * - c + b * - c
0 comments