This repository contains a Java implementation of an interpreter based on the "Crafting Interpreters" ebook by Bob Nystrom. The goal of this project is to provide a clear and concise implementation of an interpreter using plain Java, with a focus on simplicity and readability.
The "Crafting Interpreters" ebook serves as the foundation for this project, guiding the implementation of a fully functional interpreter. The focus is on understanding the principles of crafting interpreters and applying them using plain Java.
Check: Crafting Interpreters.
Follow these steps to get the interpreter up and running:
- Clone the repository:
git clone https://github.com/imbianchi/jlox.git
- Navigate to lox project directory:
cd jlox/
- Build the solution:
javac -d out com/craftinginterpreters/lox/*.java
- Run the interpreter:
java -cp out com.craftinginterpreters.lox.Lox
orjava -cp out com.craftinginterpreters.lox.Lox testFile.lox
Once the interpreter is running, you can input your own programs or use the provided examples from the Crafting Interpreters ebook. Explore the source code to gain insights into the interpreter's implementation details.
This project is licensed under the MIT License, allowing for both personal and commercial use.