CS712/CS812
Project Phase 2
Fall 2017
Due Sunday October 15


Add features to your UNH Go compiler:

  1. (50 points) This will be a re-evaluation of the first three bullet items from the Phase 1 assignment.

  2. (10 points) Blocks and Empty statements.

  3. (10 points) If and simple For statements.

  4. (10 points) Break and Continue statements (without labels).

  5. (10 points) Return statements.

  6. (10 points) Function literals (but without closures).

You should be sure to complete the first three items in the above work list because they will be used to test your Phase 3 and Phase 4 submissions. The remaining items in the list will not be used to test your Phase 3 and Phase 4 submissions.

To support the Return statement you will need to support the declaration of function results, including both named and unnamed results. You will also need to upgrade the support for the Assignment statement to allow the assignment of a function call with multiple results. And you will also need to upgrade the support for Call to allow multiple return values.

You do not need to support the call of a function with multiple results inside an argument list for another function call. Also, you do not need to detect the error where a function declares result parameters, but the function body's statement list does not end in a terminating statement.

There are some initial test files available on agate in ~cs712/public/tests/phase2.

To get full credit, your code must be adequately documented and structured. If I can't easily read and understand your code, you may lose points.

You must give me back the system in the same form that I gave it to you. I must be able to install it and run it in the exact same way as when it was delivered to you. I would also like you to keep the source code organized in the same directory hierarchy. If you fail to do this, a significant deduction will be made to your grade.

Note that there is a script, distribute.sh, in ugo/bin, which will generate a tar file for you. This tar file is what I require you to submit to me for grading.

To turn in this assignment, type (on agate.cs.unh.edu):
~cs712/bin/submit phase2 ugo.tar

Submissions can be checked by typing (on agate.cs.unh.edu):
~cs712/bin/scheck phase2

The assignment is due on Sunday October 15. There is a grace period to 8am on Monday October 16 when no late penalty will be assigned. Submissions between 8am October 16 and 8am October 17 will have a late penalty of 10 points. Submissions between 8am October 17 and 8am October 18 will have a late penalty of 30 points. No submissions will be accepted after 8am on Wednesday October 18.

Remember: you are expected to do your own work on this assignment.


Last modified on October 2, 2017.

Comments and questions should be directed to pjh@cs.unh.edu