|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.sasl.language.placeholder.syntax.ASTNode
public abstract class ASTNode
Root class for all abstract syntax tree nodes of the placeholder grammar.
| Field Summary | |
|---|---|
static int |
INDENT_PER_DEPTH
How often INDENT_STRING should be repeated in front of each line
per tree depth. |
static String |
INDENT_STRING
Indent string which will be used to pretty print an abstract syntax tree. |
| Constructor Summary | |
|---|---|
ASTNode()
Creates an empty root node. |
|
ASTNode(ASTNode parentNode)
Creates a node that has the given parent node has its parent node. |
|
| Method Summary | |
|---|---|
List<ASTNode> |
getChildNodes()
Returns a list of all child nodes of this node. |
ASTNode |
getParentNode()
Returns the parent node of this node. |
boolean |
isLeafNode()
Returns true if this node is a leaf node. |
boolean |
isRootNode()
Returns true if this node is a root node. |
abstract String |
prettyPrint(int indent)
Returns a human readable string representation of the tree spanned of by this node. |
void |
setParentNode(ASTNode parentNode)
Sets the parent node of this node. |
String |
toString()
Returns the same output as calling prettyPrint(int) with
indent=0. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int INDENT_PER_DEPTH
INDENT_STRING should be repeated in front of each line
per tree depth.
public static final String INDENT_STRING
| Constructor Detail |
|---|
public ASTNode()
public ASTNode(ASTNode parentNode)
parentNode - null or non null| Method Detail |
|---|
public ASTNode getParentNode()
public void setParentNode(ASTNode parentNode)
parentNode - null or non nullpublic boolean isRootNode()
public boolean isLeafNode()
public List<ASTNode> getChildNodes()
public abstract String prettyPrint(int indent)
throws IllegalArgumentException
indent - how often INDENT_STRING should be printed in front of
each new line at this tree depth.
IllegalArgumentException - if parameter indent is lesser than 0.public String toString()
prettyPrint(int) with
indent=0.
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||