This is an implementation of a compiler for the COOL programming language.
The manual/standard for COOL is located here: http://theory.stanford.edu/~aiken/software/cool/cool-manual.pdf
The target architecture for this compiler is MIPS. There is an excellent MIPS simulator by James Larus called SPIM, which can be used to run the output of the compiler.
- C++ compiler with C++11 support - lambda, auto, shared_ptr, vector initializer, etc
- GNU Flex
- GNU Bison
- Boost
- SPIM
- Clone the repository: git clone git://github.com/cchuahuico/COOL-Compiler.git
- cd to the root of the project
- cd src
- make
To compile COOL source files, simply run: cooc source.cl
To run the output using QtSpim:
- From the menu, click Simulator -> Settings
- Go to the MIPS tab and change the exception handler to projectroot/lib/trap.handler.s
- Click OK
- From the menu, click File -> Reinitialize and Load file
- Choose the output then OK