Java Lox implementation, following the excellent and beautifully crafted book Crafting Interpreters by Robert Nystrom.
Generate the AST and compile first:
javac com/craftinginterpreters/tool/GenerateAst.java
java com/craftinginterpreters/tool/GenerateAst com/craftinginterpreters/lox
javac com/craftinginterpreters/lox/*.javaThen, to use the interactive interpreter:
java com.craftinginterpreters.lox.Lox(The interactive interpreter doesn't allow code blocks over multiple lines.)
To run script files:
java com.craftinginterpreters.lox.Lox tests/hello-world.loxI never took out the AST printer functionality from one of the early chapters. This required me as a result to add a printer method each time I added to the AST in subsequent chapters. For that I simply looked up the reference implementation at https://github.com/munificent/craftinginterpreters/.