Skip to content

hkveeranki/Decaf-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • src contains all the code written in C++, flex and bison and CMake files
  • docs contain code documentation
  • sample_inputs contain some sample Decaf programs to test the compiler

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