Skip to content

Python Compiler for the Compiler Project Language using LLVM code generation. [FYP]

Notifications You must be signed in to change notification settings

RoryBrennan1999/PythonCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPL Python Compiler

This is my FYP project with the title of: "Design a compiler for the CE4717 Compiler Project Language that uses LLVM as a code-generation backend"

  • Written in pure Python using llvmlite
  • Takes an input .prog file and scans for tokens
  • Recursive descent parser goes through each token
  • Writes input to list file with errors pointed out (if present)
  • Generates an AST
  • Provides optimizations on the AST
  • Generates machine code using LLVM from the AST

Requisites

In order to install Python requirements, just run

pip install -r requirements.txt

Compilation

In order to compile a CPL program, run

python cpl.py <input file> <list file> <code file>

There are sample CPL source code files in the tests folder.

About

Python Compiler for the Compiler Project Language using LLVM code generation. [FYP]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages