public abstract class RegexASTNode extends Object implements IndexedState, JsonConvertible
| Modifier and Type | Field and Description |
|---|---|
protected static short |
FLAG_CHARACTER_CLASS_WAS_SINGLE_CHAR |
protected static short |
FLAG_EMPTY_GUARD |
protected static short |
FLAG_GROUP_EXPANDED_QUANTIFIER |
protected static short |
FLAG_GROUP_LOOP |
protected static short |
FLAG_HAS_LOOPS |
protected static short |
FLAG_LOOK_AROUND_NEGATED |
| Modifier | Constructor and Description |
|---|---|
protected |
RegexASTNode() |
protected |
RegexASTNode(RegexASTNode copy) |
| Modifier and Type | Method and Description |
|---|---|
protected static JsonValue |
astNodeId(RegexASTNode astNode) |
abstract RegexASTNode |
copy(RegexAST ast,
boolean recursive)
Copy this node, in one of the following ways:
if
recursive is true, recursively copy this subtree. |
boolean |
endsWithDollar() |
abstract boolean |
equalsSemantic(RegexASTNode obj) |
short |
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 |
hasEmptyGuard()
Indicates whether or not this node should be allowed to match the empty string.
|
boolean |
hasLoops() |
boolean |
idInitialized() |
void |
incMaxPath() |
void |
incMaxPath(int n) |
void |
incMinPath() |
void |
incMinPath(int n) |
boolean |
isDead()
Returns whether the node is dead, i.e.
|
protected boolean |
isFlagSet(short flag) |
boolean |
isInLookAheadAssertion() |
boolean |
isInLookBehindAssertion() |
boolean |
isPrefix()
This flag marks all nodes that were inserted into the AST for look-behind matching, see
MarkLookBehindEntriesVisitor and RegexAST.createPrefix(). |
void |
markAsDead()
Marks the node as dead, i.e.
|
void |
setEmptyGuard(boolean emptyGuard) |
void |
setEndsWithDollar() |
void |
setEndsWithDollar(boolean endsWithDollar) |
protected void |
setFlag(short flag) |
protected void |
setFlag(short flag,
boolean value) |
void |
setHasLoops() |
void |
setHasLoops(boolean hasLoops) |
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() |
protected JsonObject |
toJson(String typeName) |
String |
toStringWithID() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoJsonprotected static final short FLAG_GROUP_LOOP
protected static final short FLAG_GROUP_EXPANDED_QUANTIFIER
protected static final short FLAG_LOOK_AROUND_NEGATED
protected static final short FLAG_EMPTY_GUARD
protected static final short FLAG_HAS_LOOPS
protected static final short FLAG_CHARACTER_CLASS_WAS_SINGLE_CHAR
protected RegexASTNode()
protected RegexASTNode(RegexASTNode copy)
public abstract RegexASTNode copy(RegexAST ast, boolean recursive)
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.
ast - RegexAST the new nodes should belong to.public abstract boolean equalsSemantic(RegexASTNode obj)
public boolean idInitialized()
public short getId()
getId in interface IndexedStatepublic void setId(int id)
public RegexASTNode getParent()
public void setParent(RegexASTNode parent)
parent - protected boolean isFlagSet(short flag)
protected void setFlag(short flag)
protected void setFlag(short flag,
boolean value)
public void markAsDead()
public boolean isDead()
public boolean isPrefix()
MarkLookBehindEntriesVisitor and RegexAST.createPrefix().public void setPrefix()
RegexASTNode.isPrefix() flag to true.RegexASTNode.isPrefix()public boolean startsWithCaret()
public void setStartsWithCaret()
public void setStartsWithCaret(boolean startsWithCaret)
public boolean endsWithDollar()
public void setEndsWithDollar()
public void setEndsWithDollar(boolean endsWithDollar)
public void setHasLoops()
public void setHasLoops(boolean hasLoops)
public boolean hasLoops()
public boolean hasEmptyGuard()
public void setEmptyGuard(boolean emptyGuard)
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)
protected JsonObject toJson(String typeName)