This project is a compiler built in Python for the RPAL language.
input.rpalis at the root./test/ex7.rpalis the path to other test programs file- To run other test programs replace
input.rpalwith./test/ex7.rpalin each command
To compile and run an RPAL program, use the following command in Programming-Languages-Project> directory:
python .\myrpal.py input.rpalTo print the Abstract syntax tree of the program, use the following command in Programming-Languages-Project> directory:
python .\myrpal.py input.rpal -astTo print the Standardized Abstract syntax tree of the program, use the following command in Programming-Languages-Project> directory:
python .\myrpal.py input.rpal -stinput.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.
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.rpalAST:
Programming-Languages-Project> make run ast file=./input.rpalST:
Programming-Languages-Project> make run st file=./input.rpal