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.
- 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.
To use the compiler, follow these steps:
- Install Python on your machine if you haven't already.
- Open a terminal or command prompt.
- Navigate to the directory where the compiler.py file is located.
- Run the following command:
python compiler.py