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
Aurangzeb will be grading the projects and answering questions. You can get in touch with him at orangzeb 'at' purdue 'dot' edu. He will also be in EE 206 from 5:30pm–7pm on Wednesdays, and 2:30pm–4pm on Fridays.
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.
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.
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!
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).
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.