Submission Deadline: 5pm, October 4, 2005
In this class, you will be writing an optimizing compiler for a toy programming language, which we will call, TL05 (and targeting the SPIM MIPS Simulator.) This project is tentatively divided into six parts. The first three involve, work on the front-end (Scanning and Parsing, type-checking, IR design and generation), and the last three involve work on optimization and code generation.
You may choose C, C++, or Java to implement your compiler, but it must compile and run on the machines in the Computer Science Department's Linux lab. (If you choose C or C++, you will also need to create a makefile that will build an executable from your source files.) The entire compiler must be your own, independent work, and each assignment will build on the work of the previous assignments.
Your second assignment is to add type checking to your parser, so that incorrectly typed programs will be rejected. In addition, for all programs that parse correctly (even if they are incorrectly typed), you should create a graphviz DOT file containing that programs AST with the nodes representing (sub-)expressions annotated with their type. (You might chose to do this by coloring nodes of each type differently.)
A set of formal type rules for the TL05 programming language have been provided. But informally,
You are also required to adequately test your compiler and submit your test cases along with your source code. Agile programming techniques recommend that you do not write any code without first creating a test case that fails without that code. Your test cases should include both input (as a ASCII .tl05 file) and a description of the expected output. I may also provide some test cases.
When you have completed your assignment, you should create a tar archive or zip file containing your source files (with the correct package-based directory structure if you're using Java), the makefile (if your compiler is in C or C++), and your test cases. These should be attached to an email to vonronne@cs.utsa.edu. The subject of this email should containing the text "CS 5363 Submission #2", and the body should contain a "cover letter". This "cover letter" must contain:
As a matter of policy, late work will not be accepted. Partially completed assignments will, however, be evaluated for partial credit. This assignment depends on the parser working correctly, so the correctness or incorrectness of the scanner/parser will be considered when grading this assignment. Projects will be evaluated using a rubric similar to the following:
In addition, extra credit will be given for deficiencies in the parser that have been remedied, since part #1 was turned in. A penalty of up to 50% may be deducted if the program doesn't compile and run on the machines in the department's Linux lab.
There may need to be corrections, clarifications, or other modifications to these instructions, you are responsible for monitoring the class web site, monitoring your CS account mailboxes, and listening during lecture for announcements related to this assignment.