lngr

2.2.0 • Public • Published

lngr

Actions Status

This library provides functions for lexing and parsing a grammar based on a definition file (see sample_grammar.json).

Currently a lexer and parser are functional. The parser supports rules that reference other rules and tokens. The basic syntax for rules is rules or tokens separated by spaces.

For parsing, to specify one token/rule or another, use '|' like OPERATION INTEGER|IDENTIFIER INTEGER|IDENTIFIER. To specify optional, one-or-more, or zero-or-more of a token/rule (or a list of possible tokens/rules), use '?', '+', '*' and respectively like OPERATION (INTEGER|IDENTIFIER)?, OPERATION (INTEGER|IDENTIFIER)+, and OPERATION (INTEGER|IDENTIFIER)*.

Readme

Keywords

none

Package Sidebar

Install

npm i lngr

Weekly Downloads

2

Version

2.2.0

License

MIT

Unpacked Size

28 kB

Total Files

11

Last publish

Collaborators

  • dodgez