tree.java

来自「ANTLR(ANother Tool for Language Recognit」· Java 代码 · 共 51 行

JAVA
51
字号
package org.antlr.runtime.tree;import org.antlr.runtime.Token;/** What does a tree look like?  ANTLR has a number of support classes *  such as CommonTreeNodeStream that work on these kinds of trees.  You *  don't have to make your trees implement this interface, but if you do, *  you'll be able to use more support code. * *  NOTE: When constructing trees, ANTLR can build any kind of tree; it can *  even use Token objects as trees if you add a child list to your tokens. * *  This is a tree node without any payload; just navigation and factory stuff. */public interface Tree {	public static final Tree INVALID_NODE = new CommonTree(Token.INVALID_TOKEN);	Tree getChild(int i);	int getChildCount();	/** Add t as a child to this node.  If t is null, do nothing.  If t	 *  is nil, add all children of t to this' children.	 * @param t	 */	void addChild(Tree t);	/** Indicates the node is a nil node but may still have children, meaning	 *  the tree is a flat list.	 */	boolean isNil();	Tree dupTree();	Tree dupNode();	/** Return a token type; needed for tree parsing */	int getType();	String getText();	/** In case we don't have a token payload, what is the line for errors? */	int getLine();	int getCharPositionInLine();	String toStringTree();	String toString();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?