CS 451 - 651 Homework assignment 11 and 12




This builds on the material we've been working on, and requires hw 9 be working.


This group of assignments leads up to the final project effort for the term.  It is staged, with a little overlap, to give you flexibility in how you approach it.



Homework 11:  Function definition, call, return - phase 1

For this phase, you'll implement enough to get simple functions working.  This will include
You should be able to build, emit, and execute simple functions.  Something simple will be fine:
  { print 111;  void apple(){print 222; return;};  print 333; apple();  print 444;}
(the print's are there to help you see that things are happening in the right order!)

See Wednesday's lecture notes (augmented) for more details.

Simplifications -- things which you not need for this assignment:
We will always insist that functions must be defined before they can be called, just as a variable must be declared before its use.

Homework 12:  Functions with local variables, args, value - phase 2

Get the rest of the basic function implementation working:  fill in all the things in the bullet list above that we left out in phase 1.  Here's a bit more detail which might be helpful.

Simplifications: