An implementation of jlox from part II of Crafting Interpreters, written in python.
- Python3.10 or higher
After cloning the repository and navigating to the working directory:
git clone https://github.com/HETHAT/LoxPy
cd LoxPyYou can run the interpreter in prompt mode with:
python3 ./src/lox.pyTo run a specific file, use:
python3 ./src/lox.py example.loxReplace "example.lox" with the path to your Lox file.
$ python3 ./src/lox
> var name = "Med";
> "Hello, " + name
Hello, Med
> -(1 + 2) * (6 / 3)
-6More examples available here.