DotLox is a C# implementation of the tree-walk interpreter for Robert Nystrom's Lox programming language which is explained in his book; Crafting Interpreters.
DotLox requires the .NET 10.0 SDK or newer to build.
It can be built directly with dotnet or with make. There are two build configurations.
With make, run:
makeWith dotnet, run:
dotnet build DotLox.csprojWith make, run:
make releaseWith dotnet, run:
dotnet build DotLox.csproj --configuration ReleaseDotLox requires the .NET 10.0 runtime or newer to run.
DotLox has two modes, command line prompt and file execution.
Simply run the binary from your terminal:
dotloxYou will be given a prompt like so > and can type in and run valid Lox code.
This program can be run with rlwrap like so:
rlwrap -a dotloxThere is also a make target which can automatically run a build that is in the bin/ directory:
# For debug build
make test-dbg
# For release build
make test-relThe file you wish to run can be passed to dotlox to run it in file execution mode.
dotlox path/to/file.loxThe grammar can be found here. Further information on the Lox programming language can be found here.
Robert Nystrom's book, Crafting Interpreters.
Nrosa01's implementation, CSLox, sometimes used for comparison.