类 ParseTree
- java.lang.Object
-
- org.antlr.runtime.tree.BaseTree
-
- org.antlr.runtime.tree.ParseTree
-
- 所有已实现的接口:
Tree
public class ParseTree extends BaseTree
A record of the rules used to match a token sequence. The tokens end up as the leaves of this tree and rule nodes are the interior nodes. This really adds no functionality, it is just an alias for CommonTree that is more meaningful (specific) and holds a String to display for a node.
-
-
字段概要
字段 修饰符和类型 字段 说明 java.util.List<Token>
hiddenTokens
java.lang.Object
payload
-
从接口继承的字段 org.antlr.runtime.tree.Tree
INVALID_NODE
-
-
构造器概要
构造器 构造器 说明 ParseTree(java.lang.Object label)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
_toStringLeaves(java.lang.StringBuffer buf)
Tree
dupNode()
java.lang.String
getText()
int
getTokenStartIndex()
What is the smallest token index (indexing from 0) for this node and its children?int
getTokenStopIndex()
What is the largest token index (indexing from 0) for this node and its children?int
getType()
Return a token type; needed for tree parsingvoid
setTokenStartIndex(int index)
void
setTokenStopIndex(int index)
java.lang.String
toInputString()
Print out the leaves of this tree, which means printing original input back out.java.lang.String
toString()
Override to say how a node (not a tree) should look as textjava.lang.String
toStringWithHiddenTokens()
Emit a token and all hidden nodes before.-
从类继承的方法 org.antlr.runtime.tree.BaseTree
addChild, addChildren, createChildrenList, deleteChild, freshenParentAndChildIndexes, freshenParentAndChildIndexes, freshenParentAndChildIndexesDeeply, freshenParentAndChildIndexesDeeply, getAncestor, getAncestors, getCharPositionInLine, getChild, getChildCount, getChildIndex, getChildren, getFirstChildWithType, getLine, getParent, hasAncestor, insertChild, isNil, replaceChildren, sanityCheckParentAndChildIndexes, sanityCheckParentAndChildIndexes, setChild, setChildIndex, setParent, toStringTree
-
-
-
-
字段详细资料
-
payload
public java.lang.Object payload
-
hiddenTokens
public java.util.List<Token> hiddenTokens
-
-
方法详细资料
-
dupNode
public Tree dupNode()
-
getType
public int getType()
从接口复制的说明:Tree
Return a token type; needed for tree parsing
-
getText
public java.lang.String getText()
-
getTokenStartIndex
public int getTokenStartIndex()
从接口复制的说明:Tree
What is the smallest token index (indexing from 0) for this node and its children?
-
setTokenStartIndex
public void setTokenStartIndex(int index)
-
getTokenStopIndex
public int getTokenStopIndex()
从接口复制的说明:Tree
What is the largest token index (indexing from 0) for this node and its children?
-
setTokenStopIndex
public void setTokenStopIndex(int index)
-
toString
public java.lang.String toString()
从类复制的说明:BaseTree
Override to say how a node (not a tree) should look as text
-
toStringWithHiddenTokens
public java.lang.String toStringWithHiddenTokens()
Emit a token and all hidden nodes before. EOF node holds all hidden tokens after last real token.
-
toInputString
public java.lang.String toInputString()
Print out the leaves of this tree, which means printing original input back out.
-
_toStringLeaves
public void _toStringLeaves(java.lang.StringBuffer buf)
-
-