Skip to content

This is a recursive descent compiler built for my University programming languages translation course.

Notifications You must be signed in to change notification settings

adham404/Recursive-descent-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Compiler.py

Description

This is a simple compiler program written in Python. It takes an assignment statement and translates it into assembly code that can be executed by an assembler. Built for the programming languages translation University course.

Features

  • Recursive descent parser: The program performs executes mutually recursive functions to perform a recursive descent parse (hence the name).
  • Syntax analysis: It checks the syntax of the source code to ensure it follows the rules of the programming language.
  • Semantic analysis: The program performs semantic analysis to check for any logical errors or inconsistencies in the code.
  • Code generation: It generates assembly code for a zero address machine based on the input assignment statement.

Usage

To use the compiler, follow these steps:

  1. Install Python on your machine if you haven't already.
  2. Open a terminal or command prompt.
  3. Navigate to the directory where the compiler.py file is located.
  4. Run the following command: python compiler.py

Example

Here's an example of how to use the compiler: asciicast

About

This is a recursive descent compiler built for my University programming languages translation course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages