package lrgrep

  1. Overview
  2. Docs
Detailed error messages for Menhir-generated parsers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lrgrep-0.9.tbz
sha256=e53de12e4c5cbe6bca00643593266b4f9fa2e3f6a138195eeff7a4329f5c1c75
sha512=7fd7c4d11506fea7cc11c9bbf5aea9142d905643553c0c90e1bb16b794106b0c14a266acf89ae91b6929008dc0ba6515f788642873e2e4ba6c3d49bd45d25127

doc/kernel/Kernel/Coverage/Deter/index.html

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.