Skip to content

Latest commit

Β 

History

History
43 lines (32 loc) Β· 1.2 KB

File metadata and controls

43 lines (32 loc) Β· 1.2 KB

RPAL Compiler (Python Implementation)

This project is an RPAL (Right-reference Pedagogic Algorithmic Language) compiler implemented in Python.
It supports lexical analysis, parsing, Abstract Syntax Tree (AST) generation, Standardization (ST), and execution of RPAL programs.


πŸ“Œ Features

  • Lexical Analysis: Tokenizes the input RPAL source file.
  • Parser: Builds the syntax structure from tokens.
  • AST Generation: Produces the Abstract Syntax Tree for the program.
  • Standardization (ST): Converts the AST into a standardized form.
  • Execution: Runs RPAL programs and prints the evaluated results.

πŸ› οΈ Prerequisites

  • Python 3.11 or above
  • A text editor VS Code (optional)

πŸš€ Usage

Navigate to the project folder in your terminal before running commands.

1. Print the lexical analysis (tokens)

python myrpal.py -l file_name

2.Run the program and print result

python myrpal.py test_cases/add   

3. Print the Abstract Syntax Tree (AST)

python myrpal.py -ast test_cases/add

4. Print the Standardized Tree (ST)

python myrpal.py -st test_cases/add