A python-based compiler for the C-minus programming language
This is a python-based compiler for the C-minus -- a simpler version of the C programming language. It is developed as a project for the "Compiler Design" course at Sharif University of Technology. The compiler is developed in 3 phases:
- Scanner
- Parser
- Intermediate Code Generator
To get a local copy up and running follow these simple steps.
- Python 3.7 or higher
- anytree 2.8.0
- Clone the repo
git clone https://github.com/ckoorosh/Compiler-Project-Fall21.git
- Install Python packages
pip install -r requirements.txt
-
Your input should be in the
input.txt
file -
Run the compiler
python compiler.py
The generated code will be in the output.txt
file. The parse tree will be in the parse_tree.txt
file. The semantic and syntax errors will be in the semantic_errors.txt
and syntax_errors.txt
files.