CS152: Assignments

All programming assignments after the first (warm-up) one will be dealing with MiniJava.

Note: All assignments should be submitted via the turnin system. The turnin program always keeps the most recent version of the program submitted.

Assignment 1

Assigned: Monday, October 10, 2005, in class
Due: Monday, October 17, 2005, 23:59
Late submission accepted until: Wednesday, October 19, 2005, 23:59.

Goal: Implement the straight-line program interpreter as described on page 11 of the textbook.

Steps:

Sample straight-line programs:

Assignment 2

Assigned: Friday, October 14, 2005, in class
Due: Monday, October 24, 2005, 23:59
Late submission accepted until: Wednesday, October 26, 2005, 23:59.


[picture taken from slides by Peter H. Froelich]

Goal: Write the lexical-analysis specification for
JFlex for the MiniJava language.

Steps:

Assignment 3

Assigned: Monday, October 24, 2005, in class
Due: Friday, November 4, 2005, 23:59
Late submission accepted until: Sunday, November 6, 2005, 23:59.


[picture taken from slides by Peter H. Froelich]

Goal: Generate a parser for the
MiniJava language using the CUP parser generator.

Steps:
Submission guidelines: You should only submit your MiniJava.jflex and MiniJava.cup files. No compressed files, nor any test or script files should be submitted. Points will be taken off from your Assignment 3 grade if your submission fails to follow this guideline.

Partial outputs for some of the MiniJava programs: Sample MiniJava programs:

Assignment 4

Assigned: Monday, November 7, 2005, in class
Due: Thursday, November 17, 2005, 23:59
Late submission accepted until: Saturday, November 19, 2005, 23:59.


[picture taken from slides by Peter H. Froelich]

Goal: Add semantic actions to your parser to produce abstract syntax for the
MiniJava language.

Steps: Submission guidelines: You should submit only your MiniJava.jflex, MiniJava.cup, and PrettyPrintVisitor.java files, along with the Makefile which automates the process. No compressed files, nor any test or other script files should be submitted. We will be taking off points if your submission fails to follow this guideline.

Assignment 5

Assigned: Friday, November 18, 2005, in class
Due: Friday, December 2, 2005, 23:59
Late submission accepted until: Sunday, December 4, 2005, 23:59.

Goal: Design a set of visitors to type-check any given MiniJava program for the
MiniJava language.

Steps: Submission guidelines: You should only submit the following files:
	MiniJava.jflex
	MiniJava.cup 
 	BuildSymbolTableVisitor.java
 	TypeCheckVisitor.java
, along with your updated Makefile. No compressed files, nor any test or other script files should be submitted. We will be taking off points if your submission fails to follow this guideline.

Assignment 6

Assigned: Wednesday, November 30, 2005, in class
Due: Wednesday, December 14, 2005, 23:59
Late submission accepted until: Friday, December 16, 2005, 23:59.

Goal: Integrate all previous assignments (scanner, parser, AST generation, type checking) and write additional code to produce a working interpreter for the
MiniJava language.

Steps:
Extra credit tasks: If you finished the mandatory part of the assignment, you might want to try the following: If you solve any of the above extra credit tasks, please let us know explicitly, so that we can grade you on those: state it explicitly in the header comment, after your name, and e-mail both Vlada and Betul and let us know what you did.

Submission guidelines: You should only submit the following files:
    MiniJava.jflex
    MiniJava.cup 
    BuildSymbolTableVisitor.java
    TypeCheckVisitor.java
    InterpreterVisitor.java
    Environment.java (Only and only if you implemented inheritance)
    Makefile
No compressed files, nor any test or other script files should be turned in. We will be taking off points if your submission fails to follow this guideline.

Side note: In general, the story of scope and variable visibility can be much more complex than in MiniJava, but this is out of scope for this class. Those interested in learning more should consider registering for the CS181: Programming Languages course.