com.codemesh.terp.api
Class Node
java.lang.Object
com.codemesh.terp.api.Node
public class Node
- extends java.lang.Object
AST node for the terp language.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
parent
protected Node parent
children
protected java.util.List<Node> children
type
protected int type
tokenStart
protected Token tokenStart
tokenEnd
protected Token tokenEnd
Node
public Node(int type,
Token start,
Token end)
Node
public Node(int type,
Token start,
Token end,
Node... children)
getType
public int getType()
getParent
public Node getParent()
getNumChildren
public int getNumChildren()
getChild
public Node getChild(int index)
getChildren
public java.util.List<Node> getChildren()
addChild
public void addChild(int index,
Node child)
addChild
public void addChild(Node child)
removeAllChildren
public void removeAllChildren()
setTokenStart
public void setTokenStart(Token tokStart)
getTokenStart
public Token getTokenStart()
setTokenEnd
public void setTokenEnd(Token end)
- Sets the end token.
Necessary for scoped nodes like foreach(), if(), switch().
getTokenEnd
public Token getTokenEnd()
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
toString
public void toString(java.lang.StringBuilder buffer,
int indent)
Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.