package lrgrep
Module Kernel.AutomataSource
This module is responsible for generating a deterministic finite automaton (DFA) from a given grammar and lookahead set. The DFA is used to perform pattern matching on input tokens according to the grammar rules. The module includes several stages:
- Construction of a big DFA from the grammar and lookahead set.
- Minimization of the DFA.
- Generation of output code for the minimized DFA. The module uses various data structures and algorithms to ensure efficient construction and minimization of the DFA, as well as to generate the corresponding OCaml code.
Source
type ('g, 'n) stacks = {domain : 'n Fix.Indexing.cardinal;tops : 'n Utils.Misc.indexset;prev : 'n Fix.Indexing.index -> 'n Utils.Misc.indexset;label : 'n Fix.Indexing.index -> 'g Info.lr1 Fix.Indexing.index;
}Source
val label_to_short_string :
'a Kernel__Info.grammar ->
'a Info.Lr1.n Utils.IndexSet.t ->
string