ECE 468/573 Project Home Page

Announcements

Introduction

This project consists of implementing a simple compiler for the so called LITTLE programming language. The LITTLE language is a toy programming language designed solely for this course and it's based (however different!) on the MICRO language described in the course text book. Pay careful attention: ECE 573 students have a slightly different grammar than ECE 468 students

Project TA

Shih Yu Lee will be grading the projects and answering questions. You can get in touch with him at lee1549 'at' purdue 'dot' edu. He will also be in EE 206 from 7pm–8pm on Tuesdays, and 1:30pm–2:30pm on Thursdays.

Project Steps

Grading policy: All the points from the first 7 steps add up to 700 points (plus 10 bonus points from step0) and are worth total 30% of the project's total grade. The final step is worth 70% of the project's grade. Any submission will be tested against a set of published and hidden datasets. All hidden datasets will be published after the submission deadlines.

Building your compiler

While you can write your compiler in any language you would like, using any toolkits you have access to, we highly recommend that you use either ANTLR (http://www.antlr.org) or Flex/Bison (already installed on ECN systems) to build your compiler. ANTLR is a Java-based toolkit, while Flex/Bison are C++-based. We will be able to provide technical support only for these two tools (though we will, of course, provide conceptual help regardless of which language you choose for development).

If you are using ANTLR, you will find its API documentation invaluable. If you ware using Flex/Bison, a useful reference is here. A working example can be found here.

Running your compiler

We will compiler your compiler by running:

make clean; make compiler

Submit all source files and libraries necessary to build your compiler. Do not submit generated ANTLR-generated .java or Flex/Bison-generated .c/.cpp files. Submit the original source files and ensure that the Makefile calls ANTLR, Flex, Bison, etc. as part of its build process.

This is how we will test your compiler in Java:

java -cp lib/antlr.jar:classes/ Micro test.micro > <output file>

This is how we will test your compiler in C/C++:

./Micro test.micro > <output file>

Note that the input is being read in from a file passed as a command line argument, not redirected from STDIN, while the output is being redirected from STDOUT. If you are using a different language that C/C++ or Java, include a shell script in your submission called "Micro" that provides the same usage interface as in the C/C++ case above

We will be testing your project on the ecegrid machines, so please make sure that your projects compile and run on those systems!

Testing your generated code

For project steps 4–7, we will be testing your compiler by running your generated code through the Tiny simulator, a program that simulates a machine that supports the Tiny instruction set. A Linux version of the Tiny simulator is available here. You can also compile the Tiny simulator source yourself (you can change the number of registers by changing the NUMREGS #define).

Submission Instructions

See this page for the necessary directory structure for your project.

Submit each step using the turnin command. Instructions for using turnin are available here.