jjocram / SimpLanPlus

Compiler and runner of the SimpLanPlus language, developed as project for the course "Compilatore e Interpreti" (compilers and interpreters) at UniBO, AY 2020/21
3 stars 1 forks source link

SimpLanPlus

Repository for the course "Compilatori e interpreti" (Compilers and Interpreters) at the University of Bologna, A.Y. 2020/21.

Addendum post submission

Feel free to take a cue from this project. The evaluation was good but this project is not without errors (i.e. some edge cases are not considerated).

Instructions for compiling

mvn clean compile assembly:single

Instructions for running (after compiling)

java -jar target/SimpLanPlus.jar fileName.ext [additional args]

with fileName.ext the name of a source code file written in SimpLanPlus language or in the SVM Assembly language (read the next section for more information). The file name cannot start with a dash (-).

Additional arguments

One might add different arguments to print out additional information or change the behaviour of the program while compiling or interpreting:

By default:

Registers in the SVM

Available registers in the SVM:

Activation Record structure in the SVM

Activation Record
Dec M
Dec M-1
...
Dec 1
Par N $sp
Par N-1
...
Par 1
AL (Access Link) $fp
RA (Return Address)
Previous SP (Stack Pointer) $bsp
Previous FP (Frame Pointer)