Package org.jparsec

Class ParseTree


  • public final class ParseTree
    extends java.lang.Object
    Represents the syntactical structure of the input being parsed.
    Since:
    2.3
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseTree​(java.lang.String name, int beginIndex, int endIndex, java.lang.Object value, java.util.List<ParseTree> children)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBeginIndex()
      Returns the index in source where this node starts.
      java.util.List<ParseTree> getChildren()
      Returns the immutable list of child nodes that correspond to labeled parsers syntactically enclosed inside parent parser.
      int getEndIndex()
      Returns the index in source where this node ends.
      java.lang.String getName()
      Returns the node name, which is specified in Parser.label(java.lang.String).
      java.lang.Object getValue()
      Returns the parsed value of this node, or null if it's a failed node.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        private final java.lang.String name
      • beginIndex

        private final int beginIndex
      • endIndex

        private final int endIndex
      • value

        private final java.lang.Object value
      • children

        private final java.util.List<ParseTree> children
    • Constructor Detail

      • ParseTree

        ParseTree​(java.lang.String name,
                  int beginIndex,
                  int endIndex,
                  java.lang.Object value,
                  java.util.List<ParseTree> children)
    • Method Detail

      • getBeginIndex

        public int getBeginIndex()
        Returns the index in source where this node starts.
      • getEndIndex

        public int getEndIndex()
        Returns the index in source where this node ends.
      • getValue

        public java.lang.Object getValue()
        Returns the parsed value of this node, or null if it's a failed node.
      • getChildren

        public java.util.List<ParseTree> getChildren()
        Returns the immutable list of child nodes that correspond to labeled parsers syntactically enclosed inside parent parser.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object