terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.api
Class Node

java.lang.Object
  extended by com.codemesh.terp.api.Node

public class Node
extends java.lang.Object

AST node for the terp language.


Field Summary
protected  java.util.List<Node> children
           
protected  Node parent
           
protected  Token tokenEnd
           
protected  Token tokenStart
           
protected  int type
           
 
Constructor Summary
Node(int type, Token start, Token end)
           
Node(int type, Token start, Token end, Node... children)
           
 
Method Summary
 void addChild(int index, Node child)
           
 void addChild(Node child)
           
 Node getChild(int index)
           
 java.util.List<Node> getChildren()
           
 int getNumChildren()
           
 Node getParent()
           
 Token getTokenEnd()
           
 Token getTokenStart()
           
 int getType()
           
 void removeAllChildren()
           
 void setTokenEnd(Token end)
          Sets the end token.
 void setTokenStart(Token tokStart)
           
 java.lang.String toString()
           
 void toString(java.lang.StringBuilder buffer, int indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected Node parent

children

protected java.util.List<Node> children

type

protected int type

tokenStart

protected Token tokenStart

tokenEnd

protected Token tokenEnd
Constructor Detail

Node

public Node(int type,
            Token start,
            Token end)

Node

public Node(int type,
            Token start,
            Token end,
            Node... children)
Method Detail

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)

terp - the Codemesh Modular
Template Interpreter v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.