Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.1 KB

README.md

File metadata and controls

52 lines (35 loc) · 1.1 KB

C-minus Compiler

A python-based compiler for the C-minus programming language

About The Project

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

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • Python 3.7 or higher
  • anytree 2.8.0

Installation

  1. Clone the repo
git clone https://github.com/ckoorosh/Compiler-Project-Fall21.git
  1. Install Python packages
pip install -r requirements.txt
  1. Your input should be in the input.txt file

  2. 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.