This repository is part of a Uni-Project to write a complete Compiler for a subset of Java.
- error recovery using context sensitive anchor sets
- source annotated error messages
- MiniJava Syntax: left-factorized Grammar,
First
andFollow
sets - Lexer DEA: deterministic automata for the lexer
- Wrapper AST Prototype: Wrapper prototype written in haskell
$ ./build
# Or just:
$ ./gradlew shadowJar
# To build the `LexerDEA.svg` file:
$ dot LexerDEA.dot -T svg > LexerDEA.svg
Our tests consist of unit tests written directly in kotlin and *MjTestSuite
tests, that
run tests using all MjTest-tests directly in kotlin.
This makes it easier so use the mjtests
in the IDE.
# make sure the `test-cases` submodule is cloned
$ git submodule update --recursive
$ ./gradlew test
$ ./run <arguments>
# Or just
$ java -jar out/libs/compiler-all.jar <arguments>
Use --help
for information on CLI arguments.
The repository is organized into packages:
- ast: abstract syntax tree
- backend: assembly generation from FIRM graph
- error: error handling and output
- lexer: lexer for input tokenization
- optimization: program optimization on FIRM graph
- parser: parser for AST construction
- semantic: semantic analysis (types, names, lvalue, etc.)
- source: input handling + source file annotations
- transform: AST to FIRM graph conversion