Contents
Page-10
Prev
Next
Page+10
Index
Quadruples
A quadruple is a ``mini assignment statement''
with at most one operator.
X := A + B * C can be represented as:
T1 := B * C |
T2 := A + T1 |
X := T2
|
The four components of a quadruple are:
- Result
- Operand 1
- Operation
- Operand 2
This is sometimes called three-address code
since each quadruple involves three variables.
Advantages:
- Flat: can be written to a linear file.
- Easy to generate (rather poor) code.
- Can perform peephole optimization.