Parjac2
 
General
About
GIT

Contacts
Robert Olofsson
robo@khelekore.org

 

About


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. See java11.pj.
  • Figuring out types and actual code generation will be added based on code from parjac later on.

Compiling and running

Use 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 be used:
java --module-path=target/classes/ --module org.khelekore.parjac2/org.khelekore.parjac2.java11.TestParser /tmp/some/File.java