Programming Assignments
Please post all questions regarding the projects to the Newsgroup.
Extra Credit Programming Assignment: The Optimizer or The Test
Program
Due Friday, May 12, 2006 at 11:59 PM
Project Handout
PDF PS
Programming Assignment 6: Exceptions
Due Tuesday, May 2, 2006 at 11:59 PM
Project Handout
PDF PS
Coolaid
Coolaid can also check the long jump implementation of exceptions as
described in the project handout.
For this, the
-cool_exc option should be on. This on by default (on
the instructional machines).
See below in PA5 for additional
notes about Coolaid.
Grading (out of 50)
The point breakdown for PA5 is as follows:
- 38 points - for autograder tests
- 4 points for the README
- 4 - thorough discussion of design decisions (e.g., the
handling of let) and choice of test cases; a few paragraphs
of coherent English sentences should be fine
- 2 - vague or hard to understand; omits important details
- 0 - little to no effort
- 4 points - for example-PA6.cl
- 4 - wide range of test cases added, stressing most of the features
and error conditions discussed in the handout
- 2 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 4 points - for code cleanliness
- 4 - code is mostly clean and well-commented
- 2 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
Programming Assignment 5: The Code Generator
Due Tuesday, April 18, 2006 at 11:59 PM,
(Checkpoint Due Tuesday, April 4, 2006 at 11:59 PM)
Project Handout
PDF PS
References
Notes
- Java Version: The names of the classes for the AST nodes
(in cool-tree.java) have been renamed some. This
is to enable a cygwin distribution of the course materials.
- The Cool Runtime System Manual
contains material that used to be in Section 7 of the
Tour of Cool Support Code. You should refer to
documentation in this new manual. The online version
of Tour of Cool Support Code no longer has
this section.
- Coolaid has an option to show the Cool source file
mixed with the assembly instructions provided the Cool
compiler emits line number information. The reference
compiler will emit line number information if its passed the
-L command-line flag. Unfortunately, this output
does not work with SPIM. We have also added this option
to the project files (as emit_stabs for C++ and
Flags::emit_stabs for Java) if you like to add
this information in your own compiler. To do this,
emit at the beginning of your assembly code
.stabs "FILENAME.cl",100,0,0
where FILENAME is the name of the Cool program
you're compiling. Also, emit for each AST node
.stabn 68,0,LINE_NUMBER,0
where LINE_NUMBER is the line number associated
with that AST node.
Clarifications
- Hint for question 3 on the checkpoint: arithmetic operations
in Cool are on Int objects, while arithmetic intructions on
MIPS operate on machine words; what work must be done by your
code generator to implement Cool arithmetic operations on
the MIPS architecture?
Programming Assignment 4: The Semantic Analyzer
Due Friday, March 17, 2006 at 11:59 PM,
(Checkpoint Due Tuesday, March 7, 2006 at 11:59 PM)
Project Handout
PDF PS
Grading (out of 100)
The checkpoint for PA4 is graded pass/no pass and counts as a
WA. The point breakdown for the final submission of PA4 is as follows:
- 76 points - for autograder tests
- 8 points for the README
- 8 - thorough discussion of design decisions
and choice of test cases; a few paragraphs
of coherent English sentences should be fine
- 4 - vague or hard to understand; omits important details
- 0 - little to no effort
- 8 points - for good.cl and bad.cl
- 8 - wide range of test cases added
- 4 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 8 points - for code cleanliness
- 8 - code is mostly clean and well-commented
- 4 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
Programming Assignment 3: The Parser
Due Friday, February 17, 2006 at 11:59 PM
Project Handout
PDF PS
References
Submission
You need to modify/create and make sure to submit the following files:
- cool.y or cool.cup - the bison or CUP specification
- README - discussion of your decision decisions
- good.cl - your test cases where the parser should pass
- good.output - the output of your parser on running
good.cl
- bad.cl - your test cases where the parser should issue
an error
- bad.output - the output of your parser on running
bad.cl
Grading (out of 50)
The point breakdown for PA3 is as follows:
- 38 points - for autograder tests
- 4 points for the README
- 4 - thorough discussion of design decisions (e.g., the
handling of let) and choice of test cases; a few paragraphs
of coherent English sentences should be fine
- 2 - vague or hard to understand; omits important details
- 0 - little to no effort
- 4 points - for good.cl and bad.cl
- 4 - wide range of test cases added, stressing most Cool features
and most of the error conditions discussed in the handout
- 2 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 4 points - for code cleanliness
- 4 - code is mostly clean and well-commented
- 2 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
Programming Assignment 2: The Lexer
Due Friday, February 3, 2006 at 11:59 PM
Project Handout
PDF PS
References
Clarifications
- The LET_STMT token is only used by the parser (PA3). You
may ignore that token in PA2.
- All errors should reported by returning the ERROR token
with the specified string. Ignore the error token
(lowercase) for PA2.
- Following specification on page 15 of the Cool manual, you must
return an error for a string containing the literal null
character. The sequence of two characters "\0" is allowed
but means the one character "0".
Let me write \0 to mean the literal null.
Then, for example,
"\0 This is an invalid string."
"\\0 This is an invalid string."
"\0 This is a valid string."
- As specified on page 15 of the Cool manual, EOF can occur
in a line comment (and terminates the comment). However,
EOF cannot occur in the middle of a nested comment.
Notes
There is a sample implementation of the lexer called reference-lexer in ~cs164/bin.
Grading (out of 50)
The point breakdown for PA2 is as follows:
- 38 points - for autograder tests (1 point per correct test /
40 tests with a maximum score of 38)
- 4 points for the README
- 4 - thorough discussion of design decisions (including handling of
strings and comments) and choice of test cases; a few paragraphs
of coherent English sentences should be fine
- 2 - vague or hard to understand; omits important details
- 0 - little to no effort
- 4 points - for test.cl
- 4 - wide range of test cases added, stressing most Cool features
and most of the error conditions discussed in the handout
- 2 - added some tests, but the scope not sufficiently broad
- 0 - little to no effort
- 4 points - for code cleanliness
- 4 - code is mostly clean and well-commented
- 2 - code is sloppy and/or poorly commented in places
- 0 - little to no effort to organize and document code
Programming Assignment 1: A Cool Stack Machine
Due Friday, January 27, 2006 at 11:59 PM
Project Handout
PDF PS
References
Notes
There are some example Cool programs in ~cs164/examples.
Grading (out of 50)
The point breakdown for PA1 is as follows:
- 45 points - for autograder tests (2.25 points per test / 20 tests)
- 5 points - for a clear description of your design in the README