Eliminating Ambiguity
Rewrite productions to take the precedence of operators into account
stmt ::= matched_stmt |
unmatched_stmt
matched_stmt ::= if E then matched_stmt else matched_stmt |
other
unmatched_stmt ::= if E then stmt |
if E then matched_stmt else unmatched_stmt
Previous slide
Next slide
Back to first slide
View graphic version