00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 package org.antlr.runtime.tree;
00029
00030 import org.antlr.runtime.Token;
00031
00032 import java.util.List;
00033
00044 public interface Tree {
00045 public static final Tree INVALID_NODE = new CommonTree(Token.INVALID_TOKEN);
00046
00047 Tree getChild(int i);
00048
00049 int getChildCount();
00050
00051
00052
00053 public Tree getParent();
00054
00055 public void setParent(Tree t);
00056
00058 public boolean hasAncestor(int ttype);
00059
00061 public Tree getAncestor(int ttype);
00062
00066 public List getAncestors();
00067
00069 public int getChildIndex();
00070
00071 public void setChildIndex(int index);
00072
00074 public void freshenParentAndChildIndexes();
00075
00079 void addChild(Tree t);
00080
00082 public void setChild(int i, Tree t);
00083
00084 public Object deleteChild(int i);
00085
00091 public void replaceChildren(int startChildIndex, int stopChildIndex, Object t);
00092
00096 boolean isNil();
00097
00101 int getTokenStartIndex();
00102
00103 void setTokenStartIndex(int index);
00104
00108 int getTokenStopIndex();
00109
00110 void setTokenStopIndex(int index);
00111
00112 Tree dupNode();
00113
00115 int getType();
00116
00117 String getText();
00118
00120 int getLine();
00121
00122 int getCharPositionInLine();
00123
00124 String toStringTree();
00125
00126 String toString();
00127 }