Crate rusty_lr

Source
Expand description

§rusty_lr

A Yacc-like, procedural macro-based parser generator for Rust supporting LR(1), LALR(1), and GLR parsing strategies.

RustyLR enables you to define context-free grammars (CFGs) directly in Rust using macros or build scripts. It constructs deterministic finite automata (DFA) at compile time, ensuring efficient and reliable parsing.​

Modules§

builder
module for build DFA tables from CFG
glr
module for GLR parser
lr
module for LR(1), LALR(1) parser

Macros§

lr1
Build a LR(1) Deterministic Finite Automaton (DFA) parser.

Structs§

Backtrace
Backtracing information for parsing context. What current parser was trying to parse, and what rules were applied.
DefaultReduceActionError
Default error type for reduce action
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HashSet
A hash set implemented as a HashMap where the value is ().
LookaheadRule
shifted rule with lookahead tokens
LookaheadRuleRefSet
set of lookahead rules
ProductionRule
Production rule.
ShiftedRule
ShiftedRuleRef
A struct for single shifted named production rule.

Enums§

ReduceType
for resolving shift/reduce conflict
Token
Token represents a terminal or non-terminal symbol in the grammar.