FLC Project

In order to pass the exam the students have to implement a compiler for COOL (Classroom Object-Oriented language). This is a simple object oriented language which has been defined by Prof. Alex Aiken from Stanford University.

The language manual provides you all the information needed to develop a compiler for COOL. As first step you will have to concentrate on the Lexical and Syntax analysis phases that will have to be implemented in ANTLR. In the nextcoming lessons we will concentrate on the semantic analysis phase and on the generation of the target code.

With respect to the target code students should consider Java as the most simple objective or another language if they feel particularly confident. In the latter case please communicate your choice to the teacher.

The manual starts considering a compiler for cool generating object code in assembly for the MIPS simulator. Certainly considering assembly as the target language will permit to have a deeper understanding of the compiler construction complexity, nevertheless, given time constraints, we will not be able to treat all the necessary contents to face a similar project (in particular with respect to the management of the memory).

Therefore considering the Java as target language mainly reduce the project to the implementation of the lexical, syntax and semantic analysis being the generation of code quite straightforward.