Parjac2 is an experiment in building a java compiler.
It is supposed to be built to be easy to read, easy to run and extend.
It may be used for parsing or compiling other things in the future.
The basic parts of parjac are
- Written with a generic lexer and parser that ought to work for many more languages.
- Written with modern java in mind and using java 11 as the test bed of functionality and speed.
- A hand written java lexer. See CharBufferLexer.java.
- An earley based parser. See Parser.java.
- A grammar that tries to stay true to the grammar in
§19 of the java 11 jls.
- Figuring out types and actual code generation will be added based on code from parjac later on.
Compiling and running
mvn compile or
mvn package or any other maven
command to build.
To run the current test program from the command line something like this can
java --module-path=target/classes/ --module org.khelekore.parjac2/org.khelekore.parjac2.java11.TestParser /tmp/some/File.java