Package org.jparsec

Class ParseTree

java.lang.Object
org.jparsec.ParseTree

public final class ParseTree extends Object
Represents the syntactical structure of the input being parsed.
Since:
2.3
  • Field Details

    • name

      private final String name
    • beginIndex

      private final int beginIndex
    • endIndex

      private final int endIndex
    • value

      private final Object value
    • children

      private final List<ParseTree> children
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Returns the node name, which is specified in Parser.label(java.lang.String).
    • 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 Object getValue()
      Returns the parsed value of this node, or null if it's a failed node.
    • getChildren

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

      public String toString()
      Overrides:
      toString in class Object