School project: YAL compiler (Yet Another Language)
~$ java -jar Yal.jar source_code.yal
will generate a .mips
file.
Errors will be displayed with lines and columns in the terminal.
If everything is fine, you should see COMPILATION OK
in your console prompt.
programme YALsample debut
// declarations
entier a ;
entier b ;
fonction fonc() debut
b = fonc1() ;
retourne b ;
fin
fonction fonc1 () debut
retourne 30 ;
fin
// core
a = fonc() ;
ecrire "You should see 30 below\n" ;
ecrire a ;
fin
Compilation will be:
~$ java -jar yal.jar YALsample.yal
COMPILATION_OK
Run MIPS with MARS