Closing Exercise:
Extending Klein and Its Compiler

Thursday, December 11
12:30-12:45 PM

Suppose that we have decided to add local variables and an assignment statement to Klein. For example:

function sum_of_squares(m: integer, n: integer): integer
  local sum = 0
  sum := sum + m*m
  sum := sum + n*n
  sum

  1. Which module of your team's compiler are you most familiar with? That is, which module would you be most comfortable modifying?
  2. Describe in some detail the changes that your team would have to make to that module in order to implement the new feature?
  3. What new knowledge about compilers would you need in order to implement the new feature?
  4. How much time do you think it would take your team to implement the new feature?