Class BackReference
java.lang.Object
com.oracle.truffle.regex.tregex.parser.ast.RegexASTNode
com.oracle.truffle.regex.tregex.parser.ast.Term
com.oracle.truffle.regex.tregex.parser.ast.QuantifiableTerm
com.oracle.truffle.regex.tregex.parser.ast.BackReference
- All Implemented Interfaces:
AbstractState<Term,,ASTTransition> JsonConvertible
A reference to the contents of a previously matched capturing group.
Corresponds to the goal symbol DecimalEscape in the ECMAScript RegExp syntax.
Currently not implemented in TRegex and so any use of this node type causes TRegex to bail out.
-
Method Summary
Modifier and TypeMethodDescriptionCopy this node only, without any child nodes.copyRecursive(RegexAST ast, CompilationBuffer compilationBuffer) Recursively copy this subtree.booleanequalsSemantic(RegexASTNode obj, boolean ignoreQuantifier) int[]Returns the capture group numbers this back-reference is referring to, e.g.booleanReturnstrueiff this "back-reference" is actually a reference to a later group in the expression.booleanbooleanbooleanReturnstrueiff this back-reference refers to its own parent group.booleanReturnstrueiff this "back-reference" is actually a reference to its own parent group or a later group in the expression.booleanReturnstrueiff the parser should try to unroll this term's quantifier.voidvoidvoidvoidvoidtoJson()toString()Methods inherited from class com.oracle.truffle.regex.tregex.parser.ast.QuantifiableTerm
equalsSemantic, getQuantifier, getSubTreeParent, hasNotUnrolledQuantifier, hasQuantifier, quantifierToString, setQuantifierMethods inherited from class com.oracle.truffle.regex.tregex.parser.ast.Term
getSeqIndex, 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
-
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.- Specified by:
copyin classQuantifiableTerm- Parameters:
ast- RegexAST the node should belong to.- Returns:
- A shallow copy of this node.
-
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.
-
getGroupNumbers
public int[] getGroupNumbers()Returns the capture group numbers this back-reference is referring to, e.g. the referenced groups of\1is [1] and the references groups of\k<x>in(?:(?<x>a|?<x>b))\k<x>is [1, 2]. -
isNestedBackReference
public boolean isNestedBackReference()Returnstrueiff this back-reference refers to its own parent group. In order for this to betrue, all of the target group numbers must be nested references. -
setNestedBackReference
public void setNestedBackReference() -
isForwardReference
public boolean isForwardReference()Returnstrueiff this "back-reference" is actually a reference to a later group in the expression. In order for this to betrue, all of the target group numbers must be forward references. -
setForwardReference
public void setForwardReference() -
isNestedOrForwardReference
public boolean isNestedOrForwardReference()Returnstrueiff this "back-reference" is actually a reference to its own parent group or a later group in the expression. In order for this to betrue, all of the target group numbers must either be referenced or nested references. In JavaScript, such nested/forward references will always match the empty string. -
setNestedOrForwardReference
public void setNestedOrForwardReference() -
isIgnoreCaseReference
public boolean isIgnoreCaseReference() -
setIgnoreCaseReference
public void setIgnoreCaseReference() -
isIgnoreCaseReferenceAltMode
public boolean isIgnoreCaseReferenceAltMode() -
setIgnoreCaseReferenceAltMode
public void setIgnoreCaseReferenceAltMode() -
isUnrollingCandidate
public boolean isUnrollingCandidate()Description copied from class:QuantifiableTermReturnstrueiff the parser should try to unroll this term's quantifier.- Specified by:
isUnrollingCandidatein classQuantifiableTerm
-
equalsSemantic
- Specified by:
equalsSemanticin classQuantifiableTerm
-
toString
-
toJson
-