antlr4ts-adt

A simple calculator:

Usage no npm install needed!

<script type="module">
  import antlr4tsAdt from 'https://cdn.skypack.dev/antlr4ts-adt';
</script>

README

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