Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 1.64 KB

README.md

File metadata and controls

58 lines (44 loc) · 1.64 KB

Compiler

This repository is part of a Uni-Project to write a complete Compiler for a subset of Java.

Features

  • error recovery using context sensitive anchor sets
  • source annotated error messages

Documentation

Building

$ ./build
# Or just:
$ ./gradlew shadowJar
# To build the `LexerDEA.svg` file:
$ dot LexerDEA.dot -T svg > LexerDEA.svg

Testing

Our tests consist of unit tests written directly in kotlin and *MjTestSuitetests, 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

Running

$ ./run <arguments>
# Or just
$ java -jar out/libs/compiler-all.jar <arguments>

Use --help for information on CLI arguments.

Structure

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