Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

TypeScript port

Prerequisites:

Command line example:

  • first download the necessary node modules and create the tsconfig.json then copy the two grammar files and example.py to this directory:
    npm install typescript
    npm install typescript-collections
    npm install iconv-lite
    npm install antlr4
    npm install webpack
    npm install --save-dev @types/node
    npx tsc --init --module commonjs --types node --exactOptionalPropertyTypes false --verbatimModuleSyntax false --esModuleInterop true

Linux:

    cp ../*.g4
    cp ../example.py

Windows:

    copy ..\*.g4
    copy ..\example.py
antlr4 -Dlanguage=TypeScript PythonLexer.g4
antlr4 -Dlanguage=TypeScript PythonParser.g4
npx tsc
node grun4py.js example.py

Related link:

ANTLR4 TypeScript target