A parser for lexical grammars used by jison and jison-lex. Currently at version 0.1.4, it parses lexical grammar definitions (similar to those used by Lex/Yacc) and returns a JSON representation. It is a low-level dependency for jison tools and not commonly used directly. The package appears to be stable but rarely updated, with the last release likely years ago. Unlike higher-level alternatives like jison itself, lex-parser focuses solely on parsing the grammar syntax.
npm install lex-parserVerified import paths — ran on the pinned version, not inferred.
Shows how to install, import, and use lexParser.parse() to parse a simple lexical grammar and output JSON.
Use dynamic import or configure bundler for CommonJS compatibility.
Instead of using lex-parser directly, rely on jison or jison-lex which include it as a dependency.
Ensure grammar string includes '%%' to separate the rules section from optional trailing code.
Use either: const result = lexParser.parse('%%...'); if lexParser is the default import (CommonJS), or const { parse } = require('lex-parser'); result = parse('%%...');Install via npm: npm install lex-parser
No dependency data recorded yet.