
Short
Evaluation: Direct Code Generation 1/5
53/69
• Grammar for boolean expressions:
Note: Ambiguity!
• Modification of grammar:
E
E
Rules:
1.
5.
E or E
( E )
id

E
2.
E and E
E
3.
not E
E
4.
1) Replace rules 1. & 2. with:
E
E or M E
E
E and M E
M
e
2) Assign to
each rule the following semantic action