in spring 99 semester, we designed a compiler for compiler design course by Dr Jaberi pour in Shahid Beheshti university
language name is Roulang (Rouzbeh + language!)
- use cup as scanner generator
- use PGEN for parser generation (written by our great friends)
- create Java byte-code (class file) with ASM library
- other aspects of projects are in phase1L syntax highlighter, phase2: parser generation, phase3 : rest of compiler files
- Mehrshad Sa'adatiNia (github link)
- Roozbeh Sharifnasab (github link)
-
install maven, Java 13+
-
open terminal in this folder and run:
mvn clean package
- then you have a complete jar file (
target/RoulangCompiler-1.0-jar-with-dependencies.jar
) - to use compiler:
java -jar ./target/*s.jar path/to/in.rou /path/to/out.class
this will create an executable class file out.class
from input file in.rou
-
to run the class file:
java out
and for viewing whats in it:
javap -p out.class javap -v out.class #verbose
-
in first try to run maven, it will download dependencies, don't worry.
-
if there was problem in tests, you can skip tests (not recommended)
mvn clean package -Dmaven.test.skip=true
and then use the jar file
-
parser graph in
PGS
format is in parser folder, after editing that, createnpt
file in same directory namedtable.npt
, it will copied to folders with./updateTable.sh
. -
this project is not well debugged, don't use it in production :D
-
you can syntax highlight the language with vim, when you opened file, run:
:source syntax.vim
-
you can import other rou files as well
- Profossor JaberiPour
- Roozbeh paktinat
- Alireza Asadi
- Amin Borjian