public abstract class Term extends RegexASTNode
RegexASTNode
s except Sequence
s.
Roughly corresponds to the goal symbol Term in the ECMAScript RegExp syntax. A
Term (Term
) can be either an Assertion (PositionAssertion
or
RegexASTSubtreeRootNode
) or an Atom (CharacterClass
,
BackReference
or Group
). Quantifiers are handled by the
Group.isLoop()
flag of Group
s.
FLAG_CHARACTER_CLASS_WAS_SINGLE_CHAR, FLAG_EMPTY_GUARD, FLAG_GROUP_EXPANDED_QUANTIFIER, FLAG_GROUP_LOOP, FLAG_HAS_LOOPS, FLAG_LOOK_AROUND_NEGATED
Modifier and Type | Method and Description |
---|---|
abstract Term |
copy(RegexAST ast,
boolean recursive)
Copy this node, in one of the following ways:
if
recursive is true , recursively copy this subtree. |
boolean |
equalsSemantic(RegexASTNode obj) |
abstract boolean |
equalsSemantic(RegexASTNode obj,
boolean ignoreQuantifier) |
Token.Quantifier |
getQuantifier() |
int |
getSeqIndex() |
RegexASTSubtreeRootNode |
getSubTreeParent()
Returns the subtree root node that this node is a part of.
|
boolean |
hasQuantifier() |
protected String |
quantifierToString() |
void |
setQuantifier(Token.Quantifier quantifier) |
void |
setSeqIndex(int seqIndex) |
astNodeId, endsWithDollar, getId, getMaxPath, getMinPath, getParent, hasEmptyGuard, hasLoops, idInitialized, incMaxPath, incMaxPath, incMinPath, incMinPath, isDead, isFlagSet, isInLookAheadAssertion, isInLookBehindAssertion, isPrefix, markAsDead, setEmptyGuard, setEndsWithDollar, setEndsWithDollar, setFlag, setFlag, setHasLoops, setHasLoops, setId, setMaxPath, setMinPath, setParent, setPrefix, setStartsWithCaret, setStartsWithCaret, startsWithCaret, toJson, toStringWithID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toJson
public abstract Term copy(RegexAST ast, boolean recursive)
RegexASTNode
recursive
is true
, recursively copy this subtree. This method should
be used instead of CopyVisitor
if the copying process is required to be thread-safe.
copy
in class RegexASTNode
ast
- RegexAST the new nodes should belong to.public int getSeqIndex()
public void setSeqIndex(int seqIndex)
public boolean hasQuantifier()
public Token.Quantifier getQuantifier()
public void setQuantifier(Token.Quantifier quantifier)
public boolean equalsSemantic(RegexASTNode obj)
equalsSemantic
in class RegexASTNode
public abstract boolean equalsSemantic(RegexASTNode obj, boolean ignoreQuantifier)
protected String quantifierToString()
public RegexASTSubtreeRootNode getSubTreeParent()
RegexASTNode
RegexAST.getNFAAnchoredInitialState(int)
and
RegexAST.getNFAUnAnchoredInitialState(int)
technically don't belong to the AST, so
they will return null
.getSubTreeParent
in class RegexASTNode