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:
This is sometimes called three-address code
since each quadruple involves three variables.
- Operand 1
- Operand 2
- Flat: can be written to a linear file.
- Easy to generate (rather poor) code.
- Can perform peephole optimization.