Skip to content

ThejithaR/Programming-Languages-Project

Repository files navigation

Programming-Languages-Project

This project is a compiler built in Python for the RPAL language.

Usage

  • input.rpal is at the root
  • ./test/ex7.rpal is the path to other test programs file
  • To run other test programs replace input.rpal with ./test/ex7.rpal in each command

To compile and run an RPAL program, use the following command in Programming-Languages-Project> directory:

 python .\myrpal.py input.rpal

To print the Abstract syntax tree of the program, use the following command in Programming-Languages-Project> directory:

 python .\myrpal.py input.rpal -ast

To print the Standardized Abstract syntax tree of the program, use the following command in Programming-Languages-Project> directory:

 python .\myrpal.py input.rpal -st

input.rpal is the example program in the project description and there are other test programs in test folder named as ex1.rpal,ex2.rpal...etc.


Makefile (Not recommended if you haven't make installed on Local PC)

If Your PC have make installed ONLY you can run the same programs using makefile also,

Commands: ./input.rpal is the same file path as above and can replace with any ./tests/ex7.rpal as well

Run:

Programming-Languages-Project> make run file=./input.rpal

AST:

Programming-Languages-Project> make run ast file=./input.rpal

ST:

Programming-Languages-Project> make run st file=./input.rpal

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors