Short Evaluation: Direct Code Generation 5/5
57/69
a
or
b
and
E0 . t := Ltrue
E0 . f := Lfalse
Example: a and b or c and d:
E3. t := L1
E3. f := E1. f
E4. t := E1. t
E4. f := E1. f
E3
M1
E4
c
d
and
E5. t := L2
E5. f := E2. f
E6. t := E2. t
E6. f := E2. f
E5
M2
E6
E0
E1. t := E0. t
E1. f := L0
E1
E2
M0
E2 . t := E0. t
E2 . f := E0. f
if a goto L1
goto L0
if b goto Ltrue
goto L0
e
L1:
if c goto L2
goto Lfalse
e
L0:
if d goto Ltrue
goto Lfalse
e
L2:
Ltrue: …
Lfalse: …