This repository contains a Langium based implementation of the Lox language.
Langium requires Node.js >=20 and npm >=10 (we recommend using Volta to ensure your node & npm always match). Once you have those requirements installed, you can build the language using:
npm install
Then either use npm run watch
or npm run watch
depending on your needs.
This will automatically compile the language and other sources. Afterwards you can run the language using the Run Extension
vscode launch config.
The examples/basic.lox
file contains a small sample of what the language is capable of. Try it out!
The langium grammar contains all of the magic necessary to make the Lox language run in vscode.
It contains a grammar definition of the Lox language which is transformed into a parser for that language. Langium additionally provides advanced editor features, such as code completion, goto reference/find references, folding, and more.
In VSCode open a JavaScript Debug Terminal and then execute the following command:
node ./langium/lib/interpreter/cli.js run ./examples/basic.lox