1.1.0 • Published 11 years ago
gulp-jison-lex v1.1.0
gulp-jison-lex
Jison-lex plugin for gulp
Installation
You can install gulp-jison-lex via npm install:
npm install gulp-jison-lex
Example
var gulp = require('gulp');
var jisonLex = require('gulp-jison-lex');
gulp.task('jisonlex', function () {
return gulp.src('src/grammar.jisonlex')
.pipe(jisonLex())
.pipe(gulp.dest('dist'));
});Usage
jisonLex([options])
gulp-jison-lex currently supports the options below:
Boolean json: Parses the input files as JSON files (Default:false)String outFile: Output file path (Default:<input_file_name>.js)String moduleName: The name of the module to generate (Default:lexer)String moduleType: The type of the module to generate. Can be eitherjs,amdorcommonjs(Default:js)
Template
gulp-jison-lex supports templates (see gutil.template). Currently supported variables:
Example
var gulp = require('gulp');
var jisonLex = require('gulp-jison-lex');
gulp.task('jisonlex', function () {
return gulp.src('src/grammar.jisonlex')
.pipe(jisonLex({
outFile: '<%= path.basename %>.js', // Will produce 'grammar.js'
moduleName: '<%= path.basename %>' // Will produce 'grammar'
}))
.pipe(gulp.dest('dist'));
});License
See LICENSE.