Crate lalr [] [src]

This crate provides data structures for context-free grammars and LR(1) state machines, and an algorithm to convert a context-free grammar into an LR(1) state machine by the LALR(1) construction.

To use this crate, you should create a Grammar and call lalr1. Then you can use the LR1ParseTable to create your own parser.

Reexports

pub use Symbol::*;

Structs

Grammar

A context-free grammar.

Item

An item in an LR(0) state machine, consisting of a rule with a distinguished current position.

ItemSet

A set of Items, forming a state in an LR(0) state machine.

LR0StateMachine

An LR(0) state machine.

LR1ParseTable

An LR(1) parse table.

LR1State

A state in an LR(1) parse table.

Rhs

The right-hand side of a rule in a context-free grammar.

Enums

LR1Conflict

A conflict detected while trying to construct an LR(1) parse table.

LRAction

An action in an LR(1) parse table.

Symbol

A symbol in a context-free grammar.