- Installed ANTLR4-tools
- Installed Node.js
- first download the necessary node modules and create the
tsconfig.jsonthen 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.pyWindows:
copy ..\*.g4
copy ..\example.pyantlr4 -Dlanguage=TypeScript PythonLexer.g4
antlr4 -Dlanguage=TypeScript PythonParser.g4
npx tsc
node grun4py.js example.py