Module Coverage.DeterSource

Sourcetype ('g, 'n, 'm) node = {
  1. index : 'm Fix.Indexing.index;
  2. ker : 'n Utils.Misc.indexset;
  3. mutable top : 'g Info.lr1 Utils.Misc.indexset;
  4. mutable accept : 'g Info.terminal Utils.Misc.indexset;
  5. mutable successors : ('g Info.terminal Utils.Misc.indexset * ('g, 'n, 'm) node) array;
}

Deterministic automaton obtained by merging Andor OR nodes into single states and grouping AND nodes that branch on the same LR state. Lookahead sets are intentionally excluded from the DFA kernel to avoid combinatorial explosion.

Sourcetype ('g, 'lrc, 'n, 'm) _graph = {
  1. initials : ('lrc, 'g Info.terminal Utils.Misc.indexset * 'm Fix.Indexing.index) Utils.Misc.indexmap;
  2. nodes : ('m, ('g, 'n, 'm) node) Fix.Indexing.vector;
}
Sourcetype ('g, 'lrc, 'n) graph =
  1. | Graph : ('g, 'lrc, 'n, 'm) _graph -> ('g, 'lrc, 'n) graph
Sourceval get_lrc : ('a, 'b, 'c) Andor._graph -> ('d, 'c, 'e) node -> 'b Fix.Indexing.index

Returns the LRC state shared by all Andor nodes in the kernel of a Deter node. All Andor nodes in a Deter kernel are guaranteed to have the same LRC state.

Sourceval make : 'g Info.grammar -> ('g Info.lr1, 'g Redgraph.reduction_closure) Fix.Indexing.vector -> ('g, 'lrc) Automata.stacks -> 'g Redpos.table -> ('g, 'lrc, 'n) Andor._graph -> ('g, 'lrc, 'n) graph

Build the deterministic graph from an Andor graph. OR nodes are collapsed via epsilon transitions; AND nodes are grouped by their branching LR state. The resulting DFA tracks which Andor nodes form each kernel, along with accumulated accept sets and top LR(1) states.

Sourceval get_lr0 : 'g Info.grammar -> ('g Info.lr1, 'g Redgraph.reduction_closure) Fix.Indexing.vector -> ('g, 'lrc) Automata.stacks -> 'g Redpos.table -> ('g, 'lrc, 'n) Andor._graph -> ('g, 'lrc, 'n, 'm) _graph -> int -> 'g Kernel__Info.lr0 Utils.IndexSet.t

Compute the set of LR(0) states reachable from a Deter node. Traverses the Andor graph from the node's kernel, following OR nodes down through reduction closure trees, and collecting the LR(0) base state at each leaf. Used for mapping coverage results back to human-readable grammar states.