Institutt for Informatikk
Universitetet i Bergen
I 125 - Innføring i Programoversettelse


Voluntary Exercise Set 4 (Gruppeøvelser. 4)

  1. Exercise 3.4 on pages 138 and 139 of the text.

  2. 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

  3. Exercise 3.12 on page 140 of the text.

  4. Exercise 3.20 on page 141 of the text.

  5. Exercise 4.2 on page 189 of the text.

  6. Exercise 4.3 on page 189 of the text.