hkveeranki / Decaf-Compiler

Compiler for Decaf Programming Language
http://decaf-compiler.hkveeranki.com/
MIT License
37 stars 8 forks source link
bison compiler compiler-construction compilers course-project cpp11 decaf decaf-compiler decaf-programming-language flex llvm-ir object-oriented-programming

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

Repo structure

Building

mkdir build
cd build/
cmake ..
make 

This will create an executable named decafCompiler in build/bin directory

Running the executable

decafCompiler <input_file> > <output_file>
lli <output_file>

PS: If you like the code and you are using it, please have the courtesy to star the repo