Module Info.ReductionSource

Reduction information. A reduction represents a (state, production, lookahead set) triple, meaning that in the given state, when the lookahead terminal is in the set, the parser should reduce by the given production.

include INDEXED with type 'g n = 'g reduction
Sourcetype 'g n = 'g reduction
Sourceval cardinal : 'g grammar -> 'g n Fix.Indexing.cardinal
Sourceval of_int : 'g grammar -> int -> 'g n Fix.Indexing.index

state r returns the LR(1) state where reduction r applies

production r returns the production that reduction r reduces by

lookaheads r returns the set of lookahead terminals for reduction r. When the next input terminal is in this set, the reduction is triggered.

from_lr1 g s returns the set of all reductions applicable in LR(1) state s