Chapter 8: Intermediate Code Generation

Control flow translation of boolean expression .

if E is of the form a < b then the generated code is of the form:

if a < b goto E.true

goto E.false

E -> id1 relop id2 E.code = gen( if id1 relop id2 goto E.true) ||gen(goto E.false)

E -> true E.code= gen(goto E.true)

E -> false E.code= gen(goto E.false)