Decaf-Compiler
Description
Compiler for Decaf Programming Language. Developed as a course project for Compilers course. Decaf is a strongly-typed, object-oriented language with support for inheritance and encapsulation. By design, it has many similarities with C/C++/Java, so you should find it fairly easy to pick up. But it is not an exact match to any of those languages. The feature set has been trimmed down and simplified to keep the programming projects manageable
Approach
- Firstly, we perform lexical analysis on the given code and break down the input code into tokens.
- Next we do semantic analysis and transform this set of tokens into an AST (Abstract Syntax tree) using Vistor design pattern approach
- Once AST is prepared, we generate the Intermediate Representation