gulp-jison-lex

Jison-lex plugin for gulp

Usage no npm install needed!

<script type="module">
  import gulpJisonLex from 'https://cdn.skypack.dev/gulp-jison-lex';
</script>

README

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 either js, amd or commonjs (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.