class Kleene::MatchTracker
- Kleene::MatchTracker
- Reference
- Object
Defined in:
multi_match_dfa.crConstructors
Instance Method Summary
- #add_empty_match(nfa_with_dead_end, token_index)
-
#add_end_of_match(nfa_with_dead_end, token_index)
the end positions are inclusive of the index of the last character matched, so empty matches are not accounted for in the match_end_positions array
- #add_match(nfa : NFA, match : MatchRef)
- #add_start_of_candidate_match(nfa_with_dead_end, token_index)
-
#candidate_match_start_positions : Hash(NFA, Array(Int32))
The NFA keys in the following two structures are not the original NFAs supplied to the MultiMatchDFA.
-
#candidate_match_start_positions=(candidate_match_start_positions : Hash(NFA, Array(Int32)))
The NFA keys in the following two structures are not the original NFAs supplied to the MultiMatchDFA.
- #empty_match_positions(nfa)
- #empty_matches : Hash(NFA, Array(Int32))
- #empty_matches=(empty_matches : Hash(NFA, Array(Int32)))
- #end_positions(nfa)
- #invert_candidate_match_start_positions : Hash(Int32, Array(NFA))
-
#match_end_positions : Hash(NFA, Array(Int32))
The end positions are indices at which, after handling the character, the DFA was observed to be in a match/accept state; however, the interpretation is ambiguous, because the accepting state may be as a result of (1) transitioning to an error state that is also marked final/accepting, OR it may be as a result of transitioning to (2) a non-error final state.
-
#match_end_positions=(match_end_positions : Hash(NFA, Array(Int32)))
The end positions are indices at which, after handling the character, the DFA was observed to be in a match/accept state; however, the interpretation is ambiguous, because the accepting state may be as a result of (1) transitioning to an error state that is also marked final/accepting, OR it may be as a result of transitioning to (2) a non-error final state.
-
#matches : Hash(NFA, Array(MatchRef))
The NFA keys in the following structure are the original NFAs supplied to the MultiMatchDFA.
-
#matches=(matches : Hash(NFA, Array(MatchRef)))
The NFA keys in the following structure are the original NFAs supplied to the MultiMatchDFA.
- #matches_for(nfa)
- #start_positions(nfa)
Constructor Detail
Instance Method Detail
the end positions are inclusive of the index of the last character matched, so empty matches are not accounted for in the match_end_positions array
The NFA keys in the following two structures are not the original NFAs supplied to the MultiMatchDFA. They are the original NFAs that have been augmented with a dead end error state, so the keys are objects that are the internal state of a MultiMatchDFA
The NFA keys in the following two structures are not the original NFAs supplied to the MultiMatchDFA. They are the original NFAs that have been augmented with a dead end error state, so the keys are objects that are the internal state of a MultiMatchDFA
The end positions are indices at which, after handling the character, the DFA was observed to be in a match/accept state; however, the interpretation is ambiguous, because the accepting state may be as a result of (1) transitioning to an error state that is also marked final/accepting, OR it may be as a result of transitioning to (2) a non-error final state. In the case of (1), the match may be an empty match, where after transitioning to an error state, the DFA is in a state that is equivalent to the error state and start state and final state (e.g. as in an optional or kleene star DFA), while in the case of (2), the match may be a "normal" match. The ambiguity is problematic because it isn't clear whether the index position of the match is end inclusive end of a match or the beginning of an empty match. This ambiguity is all due to the construction of the composite DFA in the MultiMatchDFA - the dead end error states are epsilon-transitioned to the composite DFA's start state.
The end positions are indices at which, after handling the character, the DFA was observed to be in a match/accept state; however, the interpretation is ambiguous, because the accepting state may be as a result of (1) transitioning to an error state that is also marked final/accepting, OR it may be as a result of transitioning to (2) a non-error final state. In the case of (1), the match may be an empty match, where after transitioning to an error state, the DFA is in a state that is equivalent to the error state and start state and final state (e.g. as in an optional or kleene star DFA), while in the case of (2), the match may be a "normal" match. The ambiguity is problematic because it isn't clear whether the index position of the match is end inclusive end of a match or the beginning of an empty match. This ambiguity is all due to the construction of the composite DFA in the MultiMatchDFA - the dead end error states are epsilon-transitioned to the composite DFA's start state.
The NFA keys in the following structure are the original NFAs supplied to the MultiMatchDFA. This is in contrast to the augmented NFAs that are used as keys in the candidate_match_start_positions and match_end_positions structures, documented above ^^^.
The NFA keys in the following structure are the original NFAs supplied to the MultiMatchDFA. This is in contrast to the augmented NFAs that are used as keys in the candidate_match_start_positions and match_end_positions structures, documented above ^^^.