Function regex_automata::util::determinize::add_nfa_states

source ยท
pub(crate) fn add_nfa_states(
    nfa: &NFA,
    set: &SparseSet,
    builder: &mut StateBuilderNFA,
)
Expand description

Add the NFA state IDs in the given set to the given DFA builder state. The order in which states are added corresponds to the order in which they were added to set.

The DFA builder state given should already have its complete set of match pattern IDs added (if any) and any look-behind assertions (StartLF, Start and whether this state is being generated for a transition over a word byte when applicable) that are true immediately prior to transitioning into this state (via builder.look_have()). The match pattern IDs should correspond to matches that occurred on the previous transition, since all matches are delayed by one byte. The things that should not be set are look-ahead assertions (EndLF, End and whether the next byte is a word byte or not). The builder state should also not have anything in look_need set, as this routine will compute that for you.

The given NFA should be able to resolve all identifiers in set to a particular NFA state. Additionally, set must have capacity equivalent to nfa.len().