Skip to content

TerrellAW/DotLox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

105 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DotLox

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.

Build

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.

Debug

With make, run:

make

With dotnet, run:

dotnet build DotLox.csproj

Release

With make, run:

make release

With dotnet, run:

dotnet build DotLox.csproj --configuration Release

Usage

DotLox requires the .NET 10.0 runtime or newer to run.

DotLox has two modes, command line prompt and file execution.

Command Line Prompt

Simply run the binary from your terminal:

dotlox

You 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 dotlox

There 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-rel

File Execution

The file you wish to run can be passed to dotlox to run it in file execution mode.

dotlox path/to/file.lox

Syntax

The grammar can be found here. Further information on the Lox programming language can be found here.

References

Robert Nystrom's book, Crafting Interpreters.

Nrosa01's implementation, CSLox, sometimes used for comparison.

About

Implementation of Robert Nystrom's Lox from Crafting Interpreters. Implements the tree-walk interpreter version of the language in C#.

Topics

Resources

Stars

Watchers

Forks

Contributors