public final class TRegexBacktrackingNFAExecutorNode extends TRegexBacktrackerSubExecutorNode
NO_SUB_EXECUTORS, subExecutors| Constructor and Description |
|---|
TRegexBacktrackingNFAExecutorNode(RegexAST ast,
PureNFA nfa,
int numberOfTransitions,
TRegexBacktrackerSubExecutorNode[] subExecutors,
boolean mustAdvance,
CompilationBuffer compilationBuffer) |
| Modifier and Type | Method and Description |
|---|---|
TRegexExecutorLocals |
createLocals(Object 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,
boolean tString) |
protected static int |
getBackRefBoundary(TRegexBacktrackingNFAExecutorLocals locals,
PureNFATransition transition,
int cgIndex,
int index) |
String |
getName() |
boolean |
isBackrefWithNullTargetFails()
Should a backreference to an unmatched capture group succeed or fail?
|
boolean |
isForward() |
boolean |
isIgnoreCase() |
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 |
isTrackLastGroup() |
boolean |
isTransitionMatchesStepByStep()
When generating NFAs for Ruby regular expressions, the sequence of quantifier guards on a
single transition can become quite complex.
|
boolean |
isUnicode() |
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,
boolean tString,
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,
boolean tString,
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,
boolean tString,
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, 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). |
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, getEncoding, getInputLength, getMaxIndex, getMinIndex, getNumberOfCaptureGroups, getNumberOfTransitions, getSource, 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, isBooleanMatch, isUTF16, isUTF32, isUTF8, rewindUpTocreateWrapper, isInstrumentableaccept, 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 numberOfTransitions, TRegexBacktrackerSubExecutorNode[] subExecutors, boolean mustAdvance, CompilationBuffer compilationBuffer)
public TRegexBacktrackerSubExecutorNode shallowCopy()
shallowCopy in class TRegexBacktrackerSubExecutorNodepublic boolean writesCaptureGroups()
TRegexExecutorNodetrue if this executor may write any new capture group boundaries.writesCaptureGroups in class TRegexExecutorNodepublic String getName()
getName in class TRegexExecutorNodepublic boolean isForward()
isForward in class TRegexExecutorNodepublic 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 isIgnoreCase()
public boolean isUnicode()
public boolean isMustAdvance()
public boolean isLoneSurrogates()
public boolean isLoopbackInitialState()
public boolean isUseMergeExplode()
public TRegexExecutorLocals createLocals(Object input, int fromIndex, int index, int maxIndex)
createLocals in class TRegexExecutorNodepublic Object execute(com.oracle.truffle.api.frame.VirtualFrame frame, TRegexExecutorLocals abstractLocals, com.oracle.truffle.api.strings.TruffleString.CodeRange codeRange, boolean tString)
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,
boolean tString,
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,
boolean tString,
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,
boolean tString,
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, 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.api.frame.VirtualFrame, com.oracle.truffle.regex.tregex.nodes.nfa.TRegexBacktrackingNFAExecutorLocals, com.oracle.truffle.api.strings.TruffleString.CodeRange, 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.