@gerhobbelt/jison2json

v0.6.1-215
Converts jison grammar definitions to JSON
jison json grammar parser generator

jison2json

build status

jison grammars come in two formats: JSON or a special text format similar to Bison's. This utility converts from the jison's format to JSON. See the json2jison for the reverse conversion.

install

npm install @gerhobbelt/jison2json -g

build

Follow the install & build directions of the monorepo.

You can also only build this particular subpackage by cd-ing into this directory and then invoking the local make:

cd packages/jison2json
make

This will generate the rollup/babel-postprocessed ES6 and ES5 compatible libraries in the local dist/ directory.

usage

# single grammar
jison2json grammar.y

# or separate grammars
jison2json grammar.y lex.l

Or require it and convert programatically:

var jison2json = require('@gerhobbelt/jison2json');
var grammar = "%% foo: bar { return true; };";

var json = jison2json.convert(grammar);

license

MIT

npm i @gerhobbelt/jison2json

Metadata

  • MIT
  • >=4.0
  • Zach Carter
  • released 12/25/2017

Downloads

Maintainers