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 LoxPy
You can run the interpreter in prompt mode with:
python3 ./src/lox.py
To run a specific file, use:
python3 ./src/lox.py example.lox
Replace "example.lox" with the path to your Lox file.
$ python3 ./src/lox
> var name = "Med";
> "Hello, " + name
Hello, Med
> -(1 + 2) * (6 / 3)
-6
More examples available here.