Skip to content
Yuck edited this page Feb 10, 2016 · 2 revisions

AntLR 4 Javascript Project Generator (using Yeoman)

This project is intended to be a simple example of using ANTLR 4 library within a web page or as a Node.js module.

##Requirements

  • Yeoman has to be installed and contain antlr4.
  • Webpack has to be installed
npm install -g yo
npm install -g generator-antlr4
npm install -g webpack

##Usage Executing the following command will create a new project in the current folder:

yo antlr4

Yeoman will retrieve automatically the dependencies via npm.

Code generation

On the project root:

webpack

The generated output will be stored in "./dist/bundle.js", it contains all the ANTL4 library, the generated lexer and parser. The index.html page shows a very basic use of it.

Contributions to this example/generator are appreciated, don't be shy :D.

Clone this wiki locally