- Ensure
clang
,mvn
,javac
, andjava
are in the path.- Java 1.8 or newer
cd
intotest/
and runmake
cd
back to the root directory of the project- run
mvn package
- A
.jar
file will be produced totarget/c-compiler-0.0.1-SNAPSHOT-jar-with-dependencies.jar
mv target/c-compiler-0.0.1-SNAPSHOT-jar-with-dependencies.jar target/compiler.jar
- To run, use
java -jar target/compiler.jar
or, you can just call make
from the project root.
Argument | Description | Currently Supported |
---|---|---|
-help | Prints usage instructions | ✅ |
-pt | Prints tokens to console | ✅ |
-o | Destination for executable | ✅ |
-ap | Prints the abstract syntax tree | ✅ |
-stp | Prints the symbol table | ✅ |
-ap | Print the abstract syntax tree | ✅ |
-irn | read in ir from file, must have .ir extension | ✅ |
-iro | write ir to file | ✅ |
-o1 | Add optimizations (basic blocks only) | ✅ |
-pir | print ir to console | ✅ |
-pp | print the parse tree | ✅ |
-wp | write parse tree to file | ✅ |