lexigram-lib 0.9.1

Full library of the lexigram lexer/parser generator
Documentation

crate documentation crate

Lexigram

This crate is part of the Lexigram project, a lexer/parser generator.

Distinctive features:

  • Predictive, non-recursive LL(1) parser.
  • Automatic transformation of left-recursive and ambiguous rules, with automatic left factorization.
  • Grammar-driven listener pattern for better flexibility and to avoid mixing grammar with Rust source code.
  • Listener methods called directly during parsing, rather than after reconstructing a concrete syntax tree.
  • Low-latency variants for right-recursive rules and */+ repetitions.
  • Able to parse continuous input streams.

You can dive into the Lexigram book for an introduction, a tutorial, or a reference. You can also browse the crate documentation.

If you're looking for the command-line executable, you'll find it in the lexigram crate, along with a quick overview.

The lexigram-lib Crate

The lexigram-lib crate contains the low-level code that generates a lexer and a parser.

It's normally not meant to be used for other purposes than a dependency of the following crates, unless you want to create the lexicon and the grammar programmatically.

  • lexigram, the command-line lexer & parser generator
  • lexi-gram, the high-level methods and objects to generate a lexer & parser from Rust code

Status

This project is still under development and shouldn't be considered fully stable yet (hence the 0.x version). The main upcoming changes required before a stable version are:

  • for the tools
    • check robustness in corner cases, in particular by detecting problematic syntactic and lexical rules
    • improve error messages
    • refactor big methods
  • for the generated code
    • improve performances

The code and the documentation were entirely written by a human.

Releases

RELEASES.md keeps a log of all the releases (most are on the GitHub release page, too).

Licence

This code is licenced under either MIT License or Apache License 2.0, at your option.