This is my solution to the COMS22201 coursework from year 2012/2013. We were to create a compiler for a programming language "Camle". The solution is written in Java and Antler 3.
It requires antler3 and JDK 6.
In a Linux terminal type
make
Type:
antlr3 camle file_to_compile.le
There are some options that can be specified:
-syn
- generates syntax tree-irt
- generates IR tree-cg
- generates assembly code
I have completed the following parts:
- Arithmetic operations
- Variables
- Assignment statment
- read statement,
- conditional statements
- repeat loops
- simple error checking and reporting
Simple tests are provided for all of these features.