a if c else b // basic case a if c else b if d else e // is ambiguous (a if c else b) if d else e // case 1 a if c else (b if d else e) // case 2 (Python's semantics) case 1 is implemented by: expr ::= or_expr [ IF expr ELSE or_expr ]* or_expr ::= and_expr [ OR or_expr ] case 2 is implemented by: expr ::= (and_expr OR expr | and_expr) [ IF expr ELSE expr ] ----------- instructions: jumpifnot label1 jump label2 label1: label2: