Skip to content
/ ts-lox Public

Lox interpreter written in typescript.

Notifications You must be signed in to change notification settings

fbrosda/ts-lox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Implementation of the Lox language from Crafting Interpreters.

Generate Types

To regenerate the expr/ and stmt/ classes, run node ./tool/generateExpressions.cjs and node ./tool/generateStatements.cjs. This will overwrite all files in the two folders.

Setup

Build the project with make build

To start the REPL go to ./bin and execute node index.js. A script can be executed with node index.js <path-to-file>

Furthermore the AstPrinter from the book was enhanced and converted to a Scheme Transpiler, which generates executable scheme code. To transpile a script call node index.js --scheme <path-to-file>.

Known Problems

  • For the scheme transpiler, classes can only be defined on the top level.