Chapter 8: Intermediate Code Generation

E E1 or M E 2

backpatch(E 1 .falselist, M.quad)

E.truelist = merge(E1 .truelist, E2 .truelist)

E.falselist = E2 .falselist

E E 1 and M E2

backpatch(E1 .truelist, M.quad)

E.truelist = E 2 .truelist

E.falselist = merge(E1 .falselist, E2 .falselist)

E not E1

E.truelist = E 1 falselist

E.falselist = E1 .truelist

E ( E 1 )

E.truelist = E 1 .truelist

E.falselist = E1 .falselist

This is the backpatching translation scheme, continued through to the next slide.

E E1 or M E2

In this case

. if E1 is false then E2 will be looked into. Hence backpatch(E 1 .falselist, M.quad)

. If one of E1 or E2 is true then E is true, hence E.truelist = merge(E 1 .truelist, E2 .truelist)

. If E2 is checked then E1 must have been found to be false, hence Es falselist will be same as E1s falselist. Hence E.falselist = E2 .falselist

E E 1 and M E 2

. In this case if E1 is true then E2 will be looked into. Hence backpatch(E1 .truelist, M.quad)

. If one of E1 or E2 is false then E is false, hence E.falselist = merge(E1 .falselist, E 2 .falselist)

. If E2 checked then E1 must have been found to be true, hence Es truelist will be same as E2s truelist. Hence E.truelist = E2 .truelist

Similarly we can conclude for other two cases given above.