Class MatchFound
- All Implemented Interfaces:
AbstractState<Term,,ASTTransition> JsonConvertible
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 (
getNext()) themselves (see RegexAST.getNFAUnAnchoredInitialState(int)).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopy this node only, without any child nodes.copyRecursive(RegexAST ast, CompilationBuffer compilationBuffer) Recursively copy this subtree.booleangetNext()Points to the body of a regular expression when this node is treated as an initial state of an NFA.voidsetNext(RegexASTNode next) toJson()toString()Methods inherited from class com.oracle.truffle.regex.tregex.parser.ast.Term
getSeqIndex, getSubTreeParent, setSeqIndexMethods inherited from class com.oracle.truffle.regex.tregex.parser.ast.RegexASTNode
asAtomicGroup, asBackReference, asCharacterClass, asConditionalBackReferenceGroup, asGroup, asLookAheadAssertion, asLookAroundAssertion, asLookBehindAssertion, asMatchFound, asPositionAssertion, asQuantifiableTerm, asSequence, asSubexpressionCall, asSubtreeRootNode, astNodeId, endsWithDollar, getFlags, getId, getMaxPath, getMinPath, getParent, getPrefixLengthMax, getPrefixLengthMin, hasBackReferences, hasCaptureGroups, hasCaret, hasDollar, hasEmptyGuard, hasLookAheads, hasLookBehinds, hasLoops, hasQuantifiers, hasVariablePrefixLength, idInitialized, incMaxPath, incMaxPath, incMinPath, incMinPath, isAtomicGroup, isBackReference, isCaret, isCharacterClass, isConditionalBackReferenceGroup, isDead, isDollar, isExpandedQuantifier, isFlagSet, isGroup, isGroupWithGuards, isInLookAheadAssertion, isInLookBehindAssertion, isLookAheadAssertion, isLookAroundAssertion, isLookBehindAssertion, isMandatoryUnrolledQuantifier, isMatchFound, isPositionAssertion, isPrefix, isQuantifiableTerm, isQuantifierPassThroughSequence, isRoot, isSequence, isSubexpressionCall, isSubtreeRoot, markAsDead, setDead, setEmptyGuard, setEndsWithDollar, setEndsWithDollar, setExpandedQuantifier, setFlag, setFlag, setFlags, setHasBackReferences, setHasCaptureGroups, setHasCaret, setHasCaret, setHasDollar, setHasDollar, setHasLookAheads, setHasLookBehinds, setHasLoops, setHasLoops, setHasQuantifiers, setId, setMandatoryUnrolledQuantifier, setMaxPath, setMinPath, setParent, setPrefix, setPrefixLengthMax, setPrefixLengthMin, setQuantifierPassThroughSequence, setStartsWithCaret, setStartsWithCaret, startsWithCaret, toJson, toStringWithIDMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.truffle.regex.tregex.automaton.AbstractState
getId
-
Constructor Details
-
MatchFound
public MatchFound()
-
-
Method Details
-
copy
Description copied from class:RegexASTNodeCopy this node only, without any child nodes. The ID and minPath of the copied nodes is left unset. -
copyRecursive
Description copied from class:RegexASTNodeRecursively copy this subtree. This method should be used instead ofCopyVisitorif the copying process is required to be thread-safe. The ID and minPath of the copied nodes is left unset.- Specified by:
copyRecursivein classTerm- Parameters:
ast- RegexAST the new nodes should belong to.- Returns:
- A deep copy of this node.
-
getNext
Points to the body of a regular expression when this node is treated as an initial state of an NFA. If this node represents an initial state, then this points to the first expression. If this node represents a final state, then this points to the last expression. -
setNext
-
equalsSemantic
- Specified by:
equalsSemanticin classRegexASTNode
-
toString
-
toJson
-