grunt-jison
grunt plugin for jison parser
Getting Started
This plugin requires Grunt ~0.4.4
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-jison --save-dev
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "jison" task
Overview
In your project's Gruntfile, add a section named jison
to the data object passed into grunt.initConfig()
.
grunt
Options
options.moduleType
Type: String
Default value: commonjs
The type of module you want to generate with Jison.
Possible values are commonjs
, js
and amd
.
options.moduleParser
Type: String
Default value: lalr
The type of algorithm to use for the parser.
Possible values are lr0
, slr
, lalr
, `lr.
options.moduleName
Type: String
Default value: parser
When using js
for options.moduleType
, specifies the
variable name of the parser.
Usage Examples
Default Options
grunt
Custom Options
In this example, we generate a AMD module instead of a standard JS file.
grunt
Optional lex file
In this example, we generate a module with a file containing a grammar and a file containing a lexical grammar.
grunt
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
(Nothing yet)