CSC448: Three Address Code [12/14] |
From complex expressions such as "e1+f(e2, e3*(x=e4))" to three address code.
Transforming an expression results in a simple expression (a literal or a variable), declarations of new temporary variable and assignment statements for those temporary variables.
Simplifying: "++e", "e++", "e1?e2:e3"
For prefix "++e" and postfix "e++", the expression "e" must be an l-value. "++e" an l-value, but "e++" is not. "++x" is equivalent to "x = x + 1".