gulp-lex-parser
Lex-parser plugin for gulp
Installation
You can install gulp-lex-parser via npm install
:
npm install gulp-lex-parser
Example
var gulp = require('gulp');
var lexParser = require('gulp-lex-parser');
gulp.task('lex', function () {
return gulp.src('src/grammar.jisonlex')
.pipe(lexParser())
.pipe(gulp.dest('dist'));
});
Usage
lexParser([options])
gulp-lex-parser currently supports the options below:
-
String outFile
: Output file path (Default:<input_file_name>.json
)
Template
gulp-lex-parser supports templates (see gutil.template). Currently supported variables:
Object file
-
Object path
Example
var gulp = require('gulp');
var lexParser = require('gulp-lex-parser');
gulp.task('lex', function () {
return gulp.src('src/grammar.jisonlex')
.pipe(lexParser({
outFile: '<%= path.basename %>.json', // Will produce 'grammar.json
}))
.pipe(gulp.dest('dist'));
});
License
See LICENSE.