Download antlr4:
$ cd /usr/local/lib
$ sudo curl -O https://www.antlr.org/download/antlr-4.13.1-complete.jar
Install npm packages:
npm install
npm start
navigate to http://localhost:8085
Recommend using vscode and the vscode-antlr4 extension.
[re]generate grammar: source generate.sh
Ensure that you are using antlr version 4.13.1
re-save the railroad diagram to the doc/output folder from vscode:
If an expression fails to evaluate, follow these steps to debug the parser:
# populate src/test/debug.txt with the expression to test
> cd antlr
> sh debugExpression.sh
If the specification (or grammar) has changed, generate new PDF and HTML files using:
npm run spec
(note the requirement to have docker installed)
To run the tests, [re]generation of JavaScript code is necessary using the command source generate.sh
.
The tests require an 18.x version of node.
npm run test
Contributions are welcomed! Read the Contributing Guide for more information.
This project is licensed under the Apache V2 License. See LICENSE for more information.
To release the package to npm create a commit with the message
Release <version_number>
where the version_number
is the version number in the package.json file.