类 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.
    • 字段详细资料

      • payload

        public java.lang.Object payload
      • hiddenTokens

        public java.util.List<Token> hiddenTokens
    • 构造器详细资料

      • ParseTree

        public ParseTree​(java.lang.Object label)
    • 方法详细资料

      • 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
        指定者:
        toString 在接口中 Tree
        指定者:
        toString 在类中 BaseTree
      • 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)