# jison-lex

> lexical analyzer generator used by jison

Latest version **0.3.4** (published 2014-03-31) · 0 weekly downloads

## Install

```sh
npm install jison-lex
pnpm add jison-lex
yarn add jison-lex
bun add jison-lex
```

Provides the command `jison-lex`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2014-03-31 |
| First published | 2013-01-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.4 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Zach Carter |
| Maintainers | zaach |
| Keywords | jison, parser, generator, lexer, flex, tokenizer |

## Links

- npm: https://www.npmjs.com/package/jison-lex
- Repository: https://github.com/zaach/jison-lex
- Homepage: http://jison.org
- Issues: http://github.com/zaach/jison-lex/issues
- npm.io page: https://npm.io/package/jison-lex

## Dependencies (2)

- [nomnom](https://npm.io/package/nomnom.md) 1.5.2
- [lex-parser](https://npm.io/package/lex-parser.md) 0.1.x

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.3.4 (latest) — 2014-03-31
- 0.3.3 — 2014-03-30
- 0.3.2 — 2014-03-30
- 0.2.1 — 2013-06-22
- 0.2.0 — 2013-04-17
- 0.1.0 — 2013-01-28
- 0.0.1 — 2013-01-27

## README

# jison-lex
A lexical analyzer generator used by [jison](http://jison.org). It takes a lexical grammar definition (either in JSON or Bison's lexical grammar format) and outputs a JavaScript lexer.

## install
npm install jison-lex -g

## usage
```
Usage: jison-lex [file] [options]

file     file containing a lexical grammar

Options:
   -o FILE, --outfile FILE       Filename and base module name of the generated parser
   -t TYPE, --module-type TYPE   The type of module to generate (commonjs, js)
   --version                     print version and exit
```

## programatic usage

```
var JisonLex = require('jison-lex');

var grammar = {
  rules: [
    ["x", "return 'X';" ],
    ["y", "return 'Y';" ],
    ["$", "return 'EOF';" ]
  ]
};

// or load from a file
// var grammar = fs.readFileSync('mylexer.l', 'utf8');

// generate source
var lexerSource = JisonLex.generate(grammar);

// or create a parser in memory
var lexer = new JisonLex(grammar);
lexer.setInput('xyxxy');
lexer.lex();
// => 'X'
lexer.lex();
// => 'Y'

## license
MIT

---
_Source: https://npm.io/package/jison-lex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
