Assignment 4

In this assignment, you will add support for variable scopes, arithmetic operations, if statements and while loops, and pointer dereference operations to the intermediate language. You will then write some programs that use these features.

In CodeBuilders.scala, complete the implementation of binOp and the codes for the arithmetic operations after binOp.

In Transformations.scala, complete the implementation of:

  1. eliminateScopes
  2. eliminateIfStmts

Back in CodeBuilders.scala, complete the implementation of the comparison operators.

Still in CodeBuilders.scala, implement:

  1. deref
  2. assignToAddr

In A4.scala, complete the implementation of lastElement.

Back in CodeBuilders.scala, complete the implementation of whileLoop.

Back in A4.scala, complete the implementation of:

  1. arrayMaximum
  2. outputLetters
  3. printIntegerCode