Institutt for Informatikk
Universitetet i Bergen
I 125 - Innføring i Programoversettelse
Voluntary Exercise Set 4 (Gruppeøvelser. 4)
Exercise 3.4 on pages 138 and 139 of the text.
Extend the following expression grammar to include
the exponentiation operator **.
Your grammar should give ** higher precedence then either * or /,
and ** should be right associative.
Exp -> Exp AddOp Term | Term AddOp -> + | - Term -> Term MultOp Factor | Factor MultOp -> * | / Factor -> ( Exp ) | num