/glush

A parser toolkit

Primary LanguageRubyBSD Zero Clause License0BSD

Glush: A parser toolkit

Glush is a versatile parser toolkit:

  • Generates JavaScript parsers.

  • Usable as a parser combinator library in Ruby.

  • Parses LL/LR grammars in linear time.

  • Parses all context-free grammars (even the most ambiguous ones) in worst-case cubic time.

  • Scannerless: Works directly on characters (no lexer needed).

  • Streamable, push-based API: You give it one token at a time; fail-fast supported.

  • Reads EBNF grammars.

  • Flexible operator precedence.

  • Licensed under 0BSD.

Status

Glush is, as of late 2019, under active development with changes being made to the core algorithm in the v2 branch. The code in the master branch is usable, but has known deficiencies. For now it’s recommended to wait until the new implementation stabilizes and as such there is limited documentation and examples.

Planned features

  • Restructuring of the parser algorithm.

  • Documentation of EBNF format.

  • Command-line tool for parsing EBNF grammars and generating parsers.

  • Improved handling of ambiguity.

  • Generating Go parser.