Module parol::analysis::lalr1_parse_table
source · Expand description
Module with calculations for the LALR(1) parse table
LALR(1) parse table construction for the given grammar configuration.
The LALR(1) parse table is constructed using the lalr
crate.
The LALR(1) parse table is then converted into a representation without a reference to the
creating grammar.
The reference to the creating grammar is not needed for the actual parsing process. Moreover,
it inhibits the use of the parse table in other contexts.
This is the first reason why we duplicate the lalr
types here.
The second reason is that we don’t handle the eof action in the same way as the lalr
crate.
The lalr
crate uses a separate field for the eof action, while we include the eof action in
the actions field for the terminal EOI.
Structs§
- An item in the LR(0) state machine. Duplicate of the
lalr
crate’sItem
type without the reference to the creating grammar. - An item set in the LR(0) state machine. Duplicate of the
lalr
crate’sItemSet
type without the reference to the creating grammar. - A state in the LALR(1) parse table. Duplicate of the
lalr
crate’sLR1State
type without the reference to the creating grammar. - An error that occurs when a LALR(1) parse table conflict is detected. It supports better diagnostics than the plain
LRConflict
. - The LALR(1) parse table.
- A resolved LALR(1) parse table conflict.
Enums§
- A LALR(1) parse table action. The action can be either a shift, reduce, or accept action. Duplicate of the
lalr
crate’sLRAction
type without the reference to the creating grammar. - A LALR(1) parse table conflict. Duplicate of the
lalr
crate’sLR1Conflict
type without the reference to the creating grammar.
Functions§
- Calculate the LALR(1) parse table for the given grammar configuration.