public class MatchFound extends Term
MatchFound nodes are RegexASTNodes that represent the initial/final states of the
non-deterministic finite state automaton generated from the regular expression.
Regular expressions are translated into non-deterministic finite state automata, with each
RegexASTNode in the RegexAST contributing some of the states or transitions. The
MatchFound nodes are those that contribute the final (accepting) states. The root group
of every regular expression is linked (using the 'next' pointer) to a single MatchFound
node. Other MatchFound nodes appear in look-behind and look-ahead assertions, where they
contribute the final states of their subautomata (look-around assertions generate subautomata
which are then joined with the root automaton using a product construction).
MatchFound nodes are also used as initial states (the initial states of the forward
search automaton are the final states of the reverse search automaton). Therefore, there is a set
of MatchFound nodes used as final states in forward search (reachable by 'next' pointers)
and as initial states in reverse search and a set of MatchFound nodes used as final
states in reverse search (reachable by 'prev' pointers) and as initial states in forward search.
MatchFound being used as NFA initial states is also why they can have a next-pointer (
MatchFound.getNext()) themselves (see RegexAST.getNFAUnAnchoredInitialState(int)).
FLAG_CHARACTER_CLASS_WAS_SINGLE_CHAR, FLAG_EMPTY_GUARD, FLAG_GROUP_EXPANDED_QUANTIFIER, FLAG_GROUP_LOOP, FLAG_HAS_LOOPS, FLAG_LOOK_AROUND_NEGATED| Constructor and Description |
|---|
MatchFound() |
| Modifier and Type | Method and Description |
|---|---|
MatchFound |
copy(RegexAST ast,
boolean recursive)
Copy this node, in one of the following ways:
if
recursive is true, recursively copy this subtree. |
boolean |
equalsSemantic(RegexASTNode obj,
boolean ignoreQuantifier) |
RegexASTNode |
getNext() |
void |
setNext(RegexASTNode next) |
JsonValue |
toJson() |
String |
toString() |
equalsSemantic, getQuantifier, getSeqIndex, getSubTreeParent, hasQuantifier, quantifierToString, setQuantifier, setSeqIndexastNodeId, endsWithDollar, getId, getMaxPath, getMinPath, getParent, hasEmptyGuard, hasLoops, idInitialized, incMaxPath, incMaxPath, incMinPath, incMinPath, isDead, isFlagSet, isInLookAheadAssertion, isInLookBehindAssertion, isPrefix, markAsDead, setEmptyGuard, setEndsWithDollar, setEndsWithDollar, setFlag, setFlag, setHasLoops, setHasLoops, setId, setMaxPath, setMinPath, setParent, setPrefix, setStartsWithCaret, setStartsWithCaret, startsWithCaret, toJson, toStringWithIDpublic MatchFound copy(RegexAST ast, boolean recursive)
RegexASTNoderecursive is true, recursively copy this subtree. This method should
be used instead of CopyVisitor if the copying process is required to be thread-safe.
public RegexASTNode getNext()
public void setNext(RegexASTNode next)
public boolean equalsSemantic(RegexASTNode obj, boolean ignoreQuantifier)
equalsSemantic in class Termpublic JsonValue toJson()