Crate rusty_lr

source ·
Expand description

§RustyLR

LR(1) and LALR(1) code generator in Rust

For sample and examples, please refer to the GitHub repository

§Features

  • pure Rust implementation
  • readable error messages, both for grammar building and parsing
  • compile-time DFA construction from CFGs ( with proc-macro )
  • customizable reduce action
  • resolving conflicts of ambiguous grammar
  • tracing parser action with callback
  • regex patterns partially supported
  • executable for generating parser tables from CFGs
  • features=[“fxhash”] to replace std::collections::HashMap with FxHashMap

Macros§

  • build a lalr1 Deterministic Finite Automaton (DFA) parser at compile time
  • build a lalr1 Deterministic Finite Automaton (DFA) parser at runtime
  • build a lr1 Deterministic Finite Automaton (DFA) parser at compile time
  • build a lr1 Deterministic Finite Automaton (DFA) parser at runtime

Structs§

Enums§

  • Error type for grammar.build()
  • Error type for feed()
  • for resolving shift/reduce conflict
  • Token represents a terminal or non-terminal symbol in the grammar.

Traits§

  • callback trait for tracing parser actions

Type Aliases§

  • Type alias for a hash map that uses the Fx hashing algorithm.
  • Type alias for a hash set that uses the Fx hashing algorithm.