The project implements a basic compiler by applying syntax-directed translation. ARM assembly language is used as the target. The compiler is implemented using Coco/R which is a compiler generator and generates a recursive descent parser and scanner given an ATG(Attributed Translation Grammer), symbol table and a code generator.
Implementing functionalities such as:
- scalar and non scalar variables
- conditional statements: if statements, switch cases and ternary operators
- parameter passing by value
- compile-time array bound checking
To compile the project on a Unix machine:
- run 'brew install make'
- run 'make build'
- run 'make compile'
Here is a detailed report of my implementation: (https://github.com/ammarqureshi/compiler/files/1385328/Combined.Report.pdf)