public class SimpleNode extends Object implements Node
| Modifier and Type | Field and Description |
|---|---|
protected List<Node> |
children |
protected int |
id |
protected Node |
parent |
protected SyntaxTreeBuilder |
parser |
| Constructor and Description |
|---|
SimpleNode(int id) |
SimpleNode(SyntaxTreeBuilder parser,
int id) |
| Modifier and Type | Method and Description |
|---|---|
Object |
childrenAccept(SyntaxTreeBuilderVisitor visitor,
Object data)
Accept the visitor.
|
String |
dump(String prefix)
Writes a tree-like representation of this node and all of its subnodes (recursively) and returns it as a string.
|
void |
dump(String prefix,
Appendable out)
Writes a tree-like representation of this node and all of its subnodes (recursively) to the supplied Appendable.
|
Object |
jjtAccept(SyntaxTreeBuilderVisitor visitor,
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(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.
|
List<Node> |
jjtGetChildren() |
<T extends Node> |
jjtGetChildren(Class<T> type) |
int |
jjtGetNumChildren()
Return the number of children the node has.
|
Node |
jjtGetParent() |
void |
jjtInsertChild(Node n,
int i)
Adds the supplied node as the i'th child node to this node.
|
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)
Replaces this node with the supplied one in the AST.
|
void |
jjtSetParent(Node n)
This pair of methods are used to inform the node of its parent.
|
String |
toString() |
String |
toString(String prefix) |
protected Node parent
protected int id
protected SyntaxTreeBuilder parser
public SimpleNode(int id)
public SimpleNode(SyntaxTreeBuilder parser, int id)
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 void jjtAppendChild(Node n)
NodejjtAppendChild in interface Nodepublic void jjtInsertChild(Node n, int i)
NodejjtInsertChild in interface Nodepublic void jjtReplaceChild(Node oldNode, Node newNode)
NodejjtReplaceChild in interface Nodepublic void jjtReplaceWith(Node newNode)
newNode - The replacement node.public Node jjtGetChild(int i)
NodejjtGetChild in interface Nodepublic <T extends Node> T jjtGetChild(Class<T> type)
type - The type of the child node that should be returned.public int jjtGetNumChildren()
NodejjtGetNumChildren in interface Nodepublic Object jjtAccept(SyntaxTreeBuilderVisitor visitor, Object data) throws VisitorException
NodejjtAccept in interface NodeVisitorExceptionpublic Object childrenAccept(SyntaxTreeBuilderVisitor visitor, Object data) throws VisitorException
VisitorExceptionpublic void dump(String prefix, Appendable out) throws IOException
IOExceptionCopyright © 2015-2020 Eclipse Foundation. All Rights Reserved.