public class SimpleNode extends java.lang.Object implements Node
| Modifier and Type | Field and Description |
|---|---|
protected Node[] |
children |
protected int |
id |
protected Node |
parent |
protected SyntaxTreeBuilder |
parser |
protected java.lang.Object |
value |
| Constructor and Description |
|---|
SimpleNode(int i) |
SimpleNode(SyntaxTreeBuilder p,
int i) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
childrenAccept(SyntaxTreeBuilderVisitor visitor,
java.lang.Object data)
Accept the visitor.
|
void |
dump(java.lang.String prefix)
Override this method if you want to customize how the node dumps out its children.
|
int |
getId() |
boolean |
isScopeChange()
Check if this AST node constitutes a variable scope change.
|
java.lang.Object |
jjtAccept(SyntaxTreeBuilderVisitor visitor,
java.lang.Object data)
Accept the visitor.
|
void |
jjtAddChild(Node n,
int i)
This method tells the node to add its argument to the node's list of children.
|
void |
jjtAppendChild(Node n)
Adds the supplied node as the last child node to this node.
|
void |
jjtClose()
This method is called after all the child nodes have been added.
|
<T extends Node> |
jjtGetChild(java.lang.Class<T> type)
Gets the (first) child of this node that is of the specific type.
|
Node |
jjtGetChild(int i)
This method returns a child node.
|
Node[] |
jjtGetChildren() |
<T extends Node> |
jjtGetChildren(java.lang.Class<T> type) |
int |
jjtGetNumChildren()
Return the number of children the node has.
|
Node |
jjtGetParent() |
java.lang.Object |
jjtGetValue() |
void |
jjtOpen()
This method is called after the node has been made the current node.
|
void |
jjtReplaceChild(Node oldNode,
Node newNode)
Replaces a child node with a new node.
|
void |
jjtReplaceWith(Node newNode) |
void |
jjtSetParent(Node n)
This pair of methods are used to inform the node of its parent.
|
void |
jjtSetValue(java.lang.Object value) |
void |
setScopeChange(boolean isScopeChange) |
java.lang.String |
toString()
You can override these two methods in subclasses of SimpleNode to customize the way the node appears when the tree is dumped.
|
java.lang.String |
toString(java.lang.String prefix) |
protected Node parent
protected Node[] children
protected int id
protected java.lang.Object value
protected SyntaxTreeBuilder parser
public SimpleNode(int i)
public SimpleNode(SyntaxTreeBuilder p, int i)
public void jjtOpen()
Nodepublic void jjtClose()
Nodepublic void jjtSetParent(Node n)
NodejjtSetParent in interface Nodepublic Node jjtGetParent()
jjtGetParent in interface Nodepublic void jjtAddChild(Node n, int i)
NodejjtAddChild in interface Nodepublic Node jjtGetChild(int i)
NodejjtGetChild in interface Nodepublic int jjtGetNumChildren()
NodejjtGetNumChildren in interface Nodepublic void jjtSetValue(java.lang.Object value)
public java.lang.Object jjtGetValue()
public java.lang.Object jjtAccept(SyntaxTreeBuilderVisitor visitor, java.lang.Object data) throws VisitorException
jjtAccept in interface NodeVisitorExceptionpublic java.lang.Object childrenAccept(SyntaxTreeBuilderVisitor visitor, java.lang.Object data) throws VisitorException
VisitorExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String prefix)
public void dump(java.lang.String prefix)
public <T extends Node> T jjtGetChild(java.lang.Class<T> type)
type - The type of the child node that should be returned.public <T extends Node> java.util.List<T> jjtGetChildren(java.lang.Class<T> type)
public Node[] jjtGetChildren()
public void jjtReplaceWith(Node newNode)
public void jjtReplaceChild(Node oldNode, Node newNode)
NodejjtReplaceChild in interface Nodepublic void jjtAppendChild(Node n)
NodejjtAppendChild in interface Nodepublic boolean isScopeChange()
public void setScopeChange(boolean isScopeChange)
isScopeChange - the isScopeChange to setCopyright © 2025 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence