public abstract class RegexASTNode extends Object implements JsonConvertible
| Modifier | Constructor and Description |
|---|---|
protected |
RegexASTNode() |
protected |
RegexASTNode(RegexASTNode copy) |
| Modifier and Type | Method and Description |
|---|---|
AtomicGroup |
asAtomicGroup() |
BackReference |
asBackReference() |
CharacterClass |
asCharacterClass() |
Group |
asGroup() |
LookAheadAssertion |
asLookAheadAssertion() |
LookAroundAssertion |
asLookAroundAssertion() |
LookBehindAssertion |
asLookBehindAssertion() |
MatchFound |
asMatchFound() |
PositionAssertion |
asPositionAssertion() |
QuantifiableTerm |
asQuantifiableTerm() |
Sequence |
asSequence() |
RegexASTSubtreeRootNode |
asSubtreeRootNode() |
protected static JsonValue |
astNodeId(RegexASTNode astNode) |
abstract RegexASTNode |
copy(RegexAST ast)
Copy this node only, without any child nodes.
|
abstract RegexASTNode |
copyRecursive(RegexAST ast,
CompilationBuffer compilationBuffer)
Recursively copy this subtree.
|
boolean |
endsWithDollar()
All paths out of this subexpression go through
"$". |
abstract boolean |
equalsSemantic(RegexASTNode obj) |
protected int |
getFlags(int mask) |
int |
getId() |
int |
getMaxPath() |
int |
getMinPath() |
RegexASTNode |
getParent()
Gets the syntactic parent of this AST node.
|
abstract RegexASTSubtreeRootNode |
getSubTreeParent()
Returns the subtree root node that this node is a part of.
|
boolean |
hasBackReferences()
Subexpression contains
back-references. |
boolean |
hasCaptureGroups()
Subexpression contains
capturing groups. |
boolean |
hasCaret()
Subexpression contains
"^". |
boolean |
hasDollar()
Subexpression contains
"$". |
boolean |
hasEmptyGuard()
Indicates whether or not this node should be allowed to match the empty string.
|
boolean |
hasLookAheads()
Subexpression contains
look-ahead assertions. |
boolean |
hasLookBehinds()
Subexpression contains
look-behind assertions. |
boolean |
hasLoops()
Subexpression contains
loops. |
boolean |
hasQuantifiers()
Subexpression contains
not unrolled
quantifiers. |
boolean |
idInitialized() |
void |
incMaxPath() |
void |
incMaxPath(int n) |
void |
incMinPath() |
void |
incMinPath(int n) |
boolean |
isAtomicGroup() |
boolean |
isBackReference() |
boolean |
isCaret() |
boolean |
isCharacterClass() |
boolean |
isDead()
Returns whether the node is dead, i.e.
|
boolean |
isDollar() |
boolean |
isExpandedQuantifier()
Indicates whether this
RegexASTNode was inserted into the AST as the result of
expanding quantifier syntax (*, +, ?, {n,m}). |
protected boolean |
isFlagSet(int flag) |
boolean |
isGroup() |
boolean |
isInLookAheadAssertion() |
boolean |
isInLookBehindAssertion() |
boolean |
isLookAheadAssertion() |
boolean |
isLookAroundAssertion() |
boolean |
isLookBehindAssertion() |
boolean |
isMatchFound() |
boolean |
isPositionAssertion() |
boolean |
isPrefix()
This flag marks all nodes that were inserted into the AST for look-behind matching, see
MarkLookBehindEntriesVisitor and RegexAST.createPrefix(). |
boolean |
isQuantifiableTerm() |
boolean |
isRoot() |
boolean |
isSequence() |
boolean |
isSubtreeRoot() |
void |
markAsDead()
Marks the node as dead, i.e.
|
void |
setDead(boolean dead) |
void |
setEmptyGuard(boolean emptyGuard) |
void |
setEndsWithDollar() |
void |
setEndsWithDollar(boolean endsWithDollar) |
void |
setExpandedQuantifier(boolean expandedQuantifier)
Marks this
RegexASTNode as being inserted into the AST as part of expanding
quantifier syntax (*, +, ?, {n,m}). |
protected void |
setFlag(int flag) |
protected void |
setFlag(int flag,
boolean value) |
protected void |
setFlags(int newFlags,
int mask)
Update all flags denoted by
mask with the values from newFlags. |
void |
setHasBackReferences() |
void |
setHasCaptureGroups() |
void |
setHasCaret() |
void |
setHasCaret(boolean hasCaret) |
void |
setHasDollar() |
void |
setHasDollar(boolean hasDollar) |
void |
setHasLookAheads() |
void |
setHasLookBehinds() |
void |
setHasLoops() |
void |
setHasLoops(boolean hasLoops) |
void |
setHasQuantifiers() |
void |
setId(int id) |
void |
setMaxPath(int n) |
void |
setMinPath(int n) |
void |
setParent(RegexASTNode parent)
Sets the syntactic parent of this AST node.
|
void |
setPrefix()
Sets the
RegexASTNode.isPrefix() flag to true. |
void |
setStartsWithCaret() |
void |
setStartsWithCaret(boolean startsWithCaret) |
boolean |
startsWithCaret()
This subexpression is dominated by
"^". |
protected JsonObject |
toJson(String typeName) |
String |
toStringWithID() |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoJsonprotected RegexASTNode()
protected RegexASTNode(RegexASTNode copy)
public abstract RegexASTNode copy(RegexAST ast)
ast - RegexAST the node should belong to.public abstract RegexASTNode copyRecursive(RegexAST ast, CompilationBuffer compilationBuffer)
CopyVisitor if
the copying process is required to be thread-safe. The ID and minPath of the copied nodes is
left unset.ast - RegexAST the new nodes should belong to.public abstract boolean equalsSemantic(RegexASTNode obj)
public boolean idInitialized()
public final int getId()
public final void setId(int id)
public RegexASTNode getParent()
public void setParent(RegexASTNode parent)
parent - protected boolean isFlagSet(int flag)
protected void setFlag(int flag)
protected int getFlags(int mask)
protected void setFlags(int newFlags,
int mask)
mask with the values from newFlags.protected void setFlag(int flag,
boolean value)
public void markAsDead()
public void setDead(boolean dead)
public boolean isDead()
public boolean isPrefix()
MarkLookBehindEntriesVisitor and RegexAST.createPrefix().public void setPrefix()
RegexASTNode.isPrefix() flag to true.RegexASTNode.isPrefix()public boolean hasEmptyGuard()
public void setEmptyGuard(boolean emptyGuard)
public boolean hasCaret()
"^".public void setHasCaret()
public void setHasCaret(boolean hasCaret)
public boolean hasDollar()
"$".public void setHasDollar()
public void setHasDollar(boolean hasDollar)
public boolean startsWithCaret()
"^".public void setStartsWithCaret()
public void setStartsWithCaret(boolean startsWithCaret)
public boolean endsWithDollar()
"$".public void setEndsWithDollar()
public void setEndsWithDollar(boolean endsWithDollar)
public boolean hasLoops()
loops.public void setHasLoops()
public void setHasLoops(boolean hasLoops)
public boolean hasQuantifiers()
not unrolled
quantifiers.public void setHasQuantifiers()
public boolean hasCaptureGroups()
capturing groups.public void setHasCaptureGroups()
public boolean hasLookAheads()
look-ahead assertions.public void setHasLookAheads()
public boolean hasLookBehinds()
look-behind assertions.public void setHasLookBehinds()
public boolean hasBackReferences()
back-references.public void setHasBackReferences()
public boolean isExpandedQuantifier()
RegexASTNode was inserted into the AST as the result of
expanding quantifier syntax (*, +, ?, {n,m}).
E.g., if A is some term, then:
Sequences would be marked with this flag.public void setExpandedQuantifier(boolean expandedQuantifier)
RegexASTNode as being inserted into the AST as part of expanding
quantifier syntax (*, +, ?, {n,m}).RegexASTNode.isExpandedQuantifier()public int getMinPath()
public void setMinPath(int n)
public void incMinPath()
public void incMinPath(int n)
public int getMaxPath()
public void setMaxPath(int n)
public void incMaxPath()
public void incMaxPath(int n)
public abstract RegexASTSubtreeRootNode getSubTreeParent()
RegexAST.getNFAAnchoredInitialState(int) and
RegexAST.getNFAUnAnchoredInitialState(int) technically don't belong to the AST, so
they will return null.public boolean isInLookBehindAssertion()
public boolean isInLookAheadAssertion()
public String toStringWithID()
protected static JsonValue astNodeId(RegexASTNode astNode)
public boolean isBackReference()
public boolean isCharacterClass()
public boolean isGroup()
public boolean isLookAroundAssertion()
public boolean isLookAheadAssertion()
public boolean isLookBehindAssertion()
public boolean isAtomicGroup()
public boolean isMatchFound()
public boolean isPositionAssertion()
public boolean isQuantifiableTerm()
public boolean isRoot()
public boolean isSubtreeRoot()
public boolean isSequence()
public boolean isCaret()
public boolean isDollar()
public BackReference asBackReference()
public CharacterClass asCharacterClass()
public Group asGroup()
public LookAroundAssertion asLookAroundAssertion()
public LookAheadAssertion asLookAheadAssertion()
public LookBehindAssertion asLookBehindAssertion()
public AtomicGroup asAtomicGroup()
public RegexASTSubtreeRootNode asSubtreeRootNode()
public MatchFound asMatchFound()
public PositionAssertion asPositionAssertion()
public QuantifiableTerm asQuantifiableTerm()
public Sequence asSequence()
protected JsonObject toJson(String typeName)