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:
eliminateScopes
eliminateIfStmts
Back in CodeBuilders.scala, complete the implementation of the comparison operators.
Still in CodeBuilders.scala, implement:
deref
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:
arrayMaximum
outputLetters
printIntegerCode