Thus,
Temp = L[i]
as an abstract syntax tree would be
and as quadruples would be
T1 = List[i]
Temp = T1
Using "( )" to mean "contents of" and "addr" to mean "address of," the quadruples for "Temp = List[i]" would be:
T1 = addr(List)
T2 = T1 + i
Temp = (T2)
Similarly, if the array reference is on the left-hand side of an assignment statement as in "List[i] = Temp", low-level quadruples would be:
T1 = addr(List)
T2 = T1 + i
(T2) = Temp
Even if a machine has an indexing addressing mode, translating array references into their low-level format may allow optimizations (for example, if the array subscript were a common subexpression).