public final class TRegexBacktrackingNFAExecutorNode extends TRegexExecutorNode
| Modifier and Type | Field and Description |
|---|---|
static TRegexExecutorNode[] |
NO_LOOK_AROUND_EXECUTORS |
root| Constructor and Description |
|---|
TRegexBacktrackingNFAExecutorNode(PureNFAMap nfaMap,
PureNFA nfa,
TRegexExecutorNode[] lookAroundExecutors,
CompilationBuffer compilationBuffer) |
countUpTo, getAstralProfile, getBMPProfile, getEncoding, getInputLength, getMaxIndex, getMinIndex, getNumberOfCaptureGroups, inputAdvance, inputAtBegin, inputAtEnd, inputHasNext, inputHasNext, inputHasNext, inputHasNext, inputIncNextIndexRaw, inputIncNextIndexRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputReadAndDecode, inputReadAndDecode, inputReadRaw, inputReadRaw, inputReadRaw, inputReadRaw, inputSkip, inputSkipIntl, inputSkipReverse, inputUTF16IsHighSurrogate, inputUTF16IsLowSurrogate, inputUTF16ToCodePoint, rewindUpTo, setRootaccept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, toStringpublic static final TRegexExecutorNode[] NO_LOOK_AROUND_EXECUTORS
public TRegexBacktrackingNFAExecutorNode(PureNFAMap nfaMap, PureNFA nfa, TRegexExecutorNode[] lookAroundExecutors, CompilationBuffer compilationBuffer)
public void initialize(TRegexExecNode rootNode)
public boolean writesCaptureGroups()
TRegexExecutorNodetrue if this executor may write any new capture group boundaries.writesCaptureGroups in class TRegexExecutorNodepublic boolean isForward()
isForward in class TRegexExecutorNodepublic boolean isIgnoreCase()
public TRegexExecutorLocals createLocals(Object input, int fromIndex, int index, int maxIndex)
createLocals in class TRegexExecutorNodepublic Object execute(TRegexExecutorLocals abstractLocals, boolean compactString)
execute in class TRegexExecutorNodeprotected void runMergeExplode(TRegexBacktrackingNFAExecutorLocals locals, boolean compactString)
protected boolean lookAroundExecutorIsLiteral(PureNFAState s)
protected int[] runSubMatcher(TRegexBacktrackingNFAExecutorLocals subLocals, boolean compactString, PureNFAState lookAroundState)
protected static boolean subMatchFailed(PureNFAState curState, int[] subMatchResult)
protected boolean transitionMatches(TRegexBacktrackingNFAExecutorLocals locals, boolean compactString, PureNFATransition transition, int index, boolean atEnd, int c)
protected static int getBackRefBoundary(TRegexBacktrackingNFAExecutorLocals locals, PureNFATransition transition, int cgIndex, int index)
protected void updateState(TRegexBacktrackingNFAExecutorLocals locals, PureNFATransition transition, int index)
protected boolean tryUpdateState(TRegexBacktrackingNFAExecutorLocals locals, boolean compactString, PureNFATransition transition, int index, boolean atEnd, int c)
TRegexBacktrackingNFAExecutorNode.transitionMatches(com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, boolean, com.oracle.truffle.regex.tregex.nfa.PureNFATransition, int, boolean, int) with TRegexBacktrackingNFAExecutorNode.updateState(com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, com.oracle.truffle.regex.tregex.nfa.PureNFATransition, int). It is somewhat
equivalent to the following:
if (transitionMatches(locals, compactString, transition, index, atEnd, c)) {
updateState(locals, transition, index);
return true;
} else {
return false;
}
The key difference is that in this method, the TRegexBacktrackingNFAExecutorNode.updateState(com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, com.oracle.truffle.regex.tregex.nfa.PureNFATransition, int) effects of quantifier
guards are evaluated in parallel with their TRegexBacktrackingNFAExecutorNode.transitionMatches(com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, boolean, com.oracle.truffle.regex.tregex.nfa.PureNFATransition, int, boolean, int) assertions. This more
detailed behavior is necessary when working with NFA transitions that have complex chains of
quantifier guards, such as the ones used in Ruby.
NB: This method writes to locals even if it returns false.