public final class TRegexBacktrackingNFAExecutorNode extends TRegexBacktrackerSubExecutorNode
NO_SUB_EXECUTORS, subExecutorsASTRAL_PROBABILITY, BMP_PROBABILITY, CONTINUE_PROBABILITY, EXIT_PROBABILITY, LATIN1_PROBABILITY| Constructor and Description |
|---|
TRegexBacktrackingNFAExecutorNode(RegexAST ast,
PureNFA nfa,
int numberOfStates,
int numberOfTransitions,
TRegexExecutorBaseNode[] subExecutors,
boolean mustAdvance,
CompilationBuffer compilationBuffer) |
| Modifier and Type | Method and Description |
|---|---|
TRegexExecutorLocals |
createLocals(com.oracle.truffle.api.strings.TruffleString input,
int fromIndex,
int index,
int maxIndex) |
Object |
execute(com.oracle.truffle.api.frame.VirtualFrame frame,
TRegexExecutorLocals abstractLocals,
com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange) |
protected static int |
getBackRefBoundary(TRegexBacktrackingNFAExecutorLocals locals,
PureNFATransition transition,
int cgIndex,
int index) |
String |
getName() |
int |
getNumberOfStates() |
boolean |
isBackrefWithNullTargetFails()
Should a backreference to an unmatched capture group succeed or fail?
|
boolean |
isForward() |
boolean |
isLoneSurrogates() |
boolean |
isLoopbackInitialState() |
boolean |
isMonitorCaptureGroupsInEmptyCheck()
Should the empty check in
exitZeroWidth quantifier guards also check the contents of
capture groups? If the capture groups were modified, the empty check passes, even if only the
empty string was matched. |
boolean |
isMustAdvance() |
boolean |
isRecursiveBackreferences() |
boolean |
isTrackLastGroup() |
boolean |
isTransitionMatchesStepByStep()
When generating NFAs for Ruby regular expressions, the sequence of quantifier guards on a
single transition can become quite complex.
|
boolean |
isUseMergeExplode() |
protected boolean |
lookAroundExecutorIsLiteral(PureNFAState s) |
boolean |
returnsFirstGroup()
Should the reported lastGroup point to the first group that *begins* instead of the last
group that *ends*? This is needed when executing Python lookbehind expressions.
|
protected int[] |
runSubMatcher(com.oracle.truffle.api.frame.VirtualFrame frame,
TRegexBacktrackingNFAExecutorLocals subLocals,
com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange,
PureNFAState subMatcherState) |
TRegexBacktrackerSubExecutorNode |
shallowCopy() |
protected static boolean |
subMatchFailed(PureNFAState curState,
Object subMatchResult) |
protected boolean |
transitionMatches(com.oracle.truffle.api.frame.VirtualFrame frame,
TRegexBacktrackingNFAExecutorLocals locals,
com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange,
PureNFATransition transition,
int index,
boolean atEnd,
int c) |
protected boolean |
tryUpdateState(com.oracle.truffle.api.frame.VirtualFrame frame,
TRegexBacktrackingNFAExecutorLocals locals,
com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange,
PureNFATransition transition,
int index,
boolean atEnd,
int c)
This method composes
TRegexBacktrackingNFAExecutorNode.transitionMatches(com.oracle.truffle.api.frame.VirtualFrame, com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, com.oracle.truffle.api.strings.TruffleString.CodeRange, 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). |
protected void |
updateState(TRegexBacktrackingNFAExecutorLocals locals,
PureNFATransition transition,
int index) |
boolean |
writesCaptureGroups()
Returns
true if this executor may write any new capture group boundaries. |
countUpTo, getAstralProfile, getBMPProfile, getInputLength, getMaxIndex, getMinIndex, getNumberOfCaptureGroups, getNumberOfTransitions, getSource, inputAdvance, inputAtBegin, inputAtEnd, inputGetCodePointSize, inputGetCodePointSize, inputHasNext, inputHasNext, inputHasNext, inputHasNext, inputIncNextIndexRaw, inputIncNextIndexRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputIncRaw, inputReadAndDecode, inputReadAndDecode, inputReadRaw, inputReadRaw, inputReadRaw, inputReadRaw, inputSkip, inputSkipIntl, inputSkipReverse, inputUTF16IsHighSurrogate, inputUTF16IsLowSurrogate, inputUTF16ToCodePoint, isSimpleCG, rewindUpTocreateWrapper, getEncoding, isBooleanMatch, isInstrumentable, isTrivial, isUTF16, isUTF32, isUTF8, unwrapaccept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, toStringpublic TRegexBacktrackingNFAExecutorNode(RegexAST ast, PureNFA nfa, int numberOfStates, int numberOfTransitions, TRegexExecutorBaseNode[] subExecutors, boolean mustAdvance, CompilationBuffer compilationBuffer)
public TRegexBacktrackerSubExecutorNode shallowCopy()
shallowCopy in class TRegexBacktrackerSubExecutorNodepublic int getNumberOfStates()
getNumberOfStates in class TRegexExecutorBaseNodepublic boolean writesCaptureGroups()
TRegexExecutorBaseNodetrue if this executor may write any new capture group boundaries.writesCaptureGroups in class TRegexExecutorBaseNodepublic String getName()
getName in class TRegexExecutorBaseNodepublic boolean isForward()
isForward in class TRegexExecutorBaseNodepublic boolean isBackrefWithNullTargetFails()
public boolean isMonitorCaptureGroupsInEmptyCheck()
exitZeroWidth quantifier guards also check the contents of
capture groups? If the capture groups were modified, the empty check passes, even if only the
empty string was matched.public boolean isTransitionMatchesStepByStep()
public boolean isTrackLastGroup()
public boolean isMustAdvance()
public boolean isLoneSurrogates()
public boolean isLoopbackInitialState()
public boolean isUseMergeExplode()
public boolean isRecursiveBackreferences()
public TRegexExecutorLocals createLocals(com.oracle.truffle.api.strings.TruffleString input, int fromIndex, int index, int maxIndex)
createLocals in class TRegexExecutorBaseNodepublic Object execute(com.oracle.truffle.api.frame.VirtualFrame frame, TRegexExecutorLocals abstractLocals, com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange)
execute in class TRegexExecutorBaseNodepublic boolean returnsFirstGroup()
protected boolean lookAroundExecutorIsLiteral(PureNFAState s)
protected int[] runSubMatcher(com.oracle.truffle.api.frame.VirtualFrame frame,
TRegexBacktrackingNFAExecutorLocals subLocals,
com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange,
PureNFAState subMatcherState)
protected static boolean subMatchFailed(PureNFAState curState, Object subMatchResult)
protected boolean transitionMatches(com.oracle.truffle.api.frame.VirtualFrame frame,
TRegexBacktrackingNFAExecutorLocals locals,
com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange,
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(com.oracle.truffle.api.frame.VirtualFrame frame,
TRegexBacktrackingNFAExecutorLocals locals,
com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange,
PureNFATransition transition,
int index,
boolean atEnd,
int c)
TRegexBacktrackingNFAExecutorNode.transitionMatches(com.oracle.truffle.api.frame.VirtualFrame, com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, com.oracle.truffle.api.strings.TruffleString.CodeRange, 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.api.frame.VirtualFrame, com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, com.oracle.truffle.api.strings.TruffleString.CodeRange, 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.