Skip to content

A python-based compiler for the C-minus programming language | Compiler Design Course Project, Fall 2021

Notifications You must be signed in to change notification settings

mofayezi/Compiler-Project-Fall21

Repository files navigation


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.

About

A python-based compiler for the C-minus programming language | Compiler Design Course Project, Fall 2021

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages