Date: Wed, 20 Nov 1996 22:39:22 GMT Server: NCSA/1.5.1 Last-modified: Wed, 20 Nov 1996 16:17:39 GMT Content-type: text/html Content-length: 5729
Office: Nichols 324E
Email: dwyer@cis.ksu.edu
WWW: http://www.cis.ksu.edu/~
dwyer
Phone: 532-6350
Office Hours: MW 2:30-3:30, Thu 2:00-3:00
The project consists of implementing a compiler for a Pascal-like language with classes. You may write your compiler in C, C++, Pascal or Ada (if you really want to write it in another language come and talk to me). I expect the code to be clearly organized and documented (I am very serious about this). If you use either C, C++ or Ada you can write your lexical analyzer using a scanner generator, such as flex (see "man flexdoc" for details). If you use another language you will have to build the lexical analyzer by hand. Regardless of the implementation language you will build a top-down recursive descent parser. This parser will produce an abstract syntax tree intermediate representation from which code will be generated. You may use the VCG tool to quickly and easily produce postscript depictions of your syntax trees. Your compiler will generate assembly code for the MIPS R2000/R3000. Generated programs will be executed on a MIPS simulator called spim. If you don't already know about machine architecture and assembly language programming you might start to browse the spim document.
The compiler will be implemented in four phase:
The project can be implemented either independently or in pairs. Those who chose to work in pairs will be expected to perform some local optimization of the generated code. This will involve building an additional phase to perform the IR optimization.
In part, this is an exercise in building a large software system with reasonably complicated component interactions. You will not be graded on the quality of the generated code. Correctness of the code, however, is very important. I will make a number of test files available prior to the due date of each stage. You are encouraged to use these to test your implementation. I may execute your projects on those (and other) test files. You may also create tests of your own. If there is sufficient interest we can create a class wide collection of test cases for all to use.
All students are encouraged to talk to each other about compiler concepts, design alternatives, implementation details, etc. The final product should be of your own creation. If you copy other's work you will not be prepared for the exam and you will not maximize the benefit you get from this course.
On all assignments, you are expected to do your own work. From the Provost's office: "Plagiarism and cheating are serious offenses and may be punished by failure on the exam, paper or project, failure in the course and/or expulsion from the University. For more information refer to the `Academic Dishonesty' policy in `Inside KSU'".