Skip to content

C# implementation of Lox interpreter from crafting interpreters book by Robert Nystrom

Notifications You must be signed in to change notification settings

MohadKamil/LoxSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoxSharp

This is a C# interpreter for the Lox language, following the great and detailed guide and book Crafting Interpreters By Robert Nystrom.

How to run it

To run the interpreter:

  • insure you have dotnet 7 SDK installed, verify using the version command
dotnet --version
  • Navigate to the root folder containing the solution file and run the command:
dotnet run --project ./LoxSharp/LoxSharp.csproj

This will run the interpreter in REPL mode and you will be able to execute statements directly, the recording below has some example interaction with the REPL.

asciicast

Passing Code Files

you can pass lox file to intepreter by including a path to it as command argument, below is an example using on of the included Lox example files

dotnet run --project .\LoxSharp\LoxSharp.csproj .\Examples\HelloWorld.txt

About

C# implementation of Lox interpreter from crafting interpreters book by Robert Nystrom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages