grunt plugin for jison parser
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.loadNpmTasks('grunt-jison');
In your project's Gruntfile, add a section named jison
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
jison: {
target : {
options: {
// Task-specific options go here.
},
files: {
// Target-specific file lists and/or options go here.
}
}
}
})
Type: String
Default value: commonjs
The type of module you want to generate with Jison.
Possible values are commonjs
, js
and amd
.
Type: String
Default value: lalr
The type of algorithm to use for the parser.
Possible values are lr0
, slr
, lalr
, `lr.
Type: String
Default value: parser
When using js
for options.moduleType
, specifies the
variable name of the parser.
grunt.initConfig({
jison: {
my_parser : {
files: { 'generated-parser.js': 'grammar-file.jison' }
}
}
})
In this example, we generate a AMD module instead of a standard JS file.
grunt.initConfig({
jison: {
target : {
options: { moduleType: 'amd' },
files: { 'generated-parser.amd.js': 'grammar-file.jison' }
}
}
})
In this example, we generate a module with a file containing a grammar and a file containing a lexical grammar.
grunt.initConfig({
jison: {
target : {
options: { moduleType: 'amd' },
files: { 'generated-parser.amd.js': ['grammar-file.jison', 'lex-file.jisonlex'}
}
}
})
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.
(Nothing yet)