项目作者: harry-7

项目描述 :
Compiler for Decaf Programming Language
高级语言: C++
项目地址: git://github.com/harry-7/Decaf-Compiler.git
创建时间: 2016-09-20T21:38:16Z
项目社区:https://github.com/harry-7/Decaf-Compiler

开源协议:MIT License

下载


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

  1. mkdir build
  2. cd build/
  3. cmake ..
  4. make

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

Running the executable

  1. decafCompiler <input_file> > <output_file>
  2. lli <output_file>

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