0.0.4 • Published 3 years ago

antlr4ts-adt v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Generate ADT Typescript files for ANTLR4 grammars from antlr4ts files.

Example

A simple calculator:

Demo using the example/ from sources:

$ git clone https://github.com/tokland/antlr4ts-adt
$ cd example
$ yarn install

$ npx antlr4ts Calculator.g4 -o antlr4 -visitor
$ npx antlr4ts-adt antlr4/CalculatorParser.ts
$ npx ts-node calculator.ts "1 + product(5 - 2, 2) + sum(1, 2, 2 + 1)"
# 13