Project Overview

The compiler construction project will involve development of a compiler for Decaf language. The language is a subset of C++ and Java. The projects will cover implementation of lexical scanning, parsing, abstract syntax trees and semantic analysis, code generation for the Decaf language. The final project is an open-ended project in which the groups would implement compiler based optimization and compete for the "most optimized code" competition. Startup files for the projects will be distributed through CTools .

Decaf Language Overview PDF

Collaboration:

All projects are to be completed in a 2 member group. Prior permission is required for different group structure. We expect adherence to the Engineering Honor Code in all assignments. More here.

Late Policy:

Each group has a total of three late days. You may apply these late days in any way that you choose across the five projects. Late days can only be claimed in units of full days. If you are one hour late, that counts as being one day late. After your group has used up the three late days, a 25% penalty will be imposed for each additional calendar day.

Grading Policy:

The grading will be done using an auto grader followed by manual correction of the files. The grades will be based on the number of test cases your submission can handle correctly.

Feedback Policy:

You are allowed to submit your work once for feedback before the programming assignment is due. If you submit your work four days before the deadline, the feedback will be mailed within a day or two of your submission. The feedback will tell you how many test cases you are able to pass. You are encouraged to sumbit your project for feedback much earlier, so that you have sufficient time to address any issue.

Additional Resources

Flex - a lex compatible scanner

Flex documentation by Vern Paxson

Bison - a yacc compatible parser

Bison Documentation by Charles Donnelly and Richard Stallman

SPIM - a simulator for the MIPS architecture

The SPIM Manual - Appendix from Hennessy & Patterson's architecture book

Acknowledgement