Package org.jparsec
Class ParseTree
- java.lang.Object
-
- org.jparsec.ParseTree
-
public final class ParseTree extends java.lang.Object
Represents the syntactical structure of the input being parsed.- Since:
- 2.3
-
-
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 tolabeled
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 inParser.label(java.lang.String)
.java.lang.Object
getValue()
Returns the parsed value of this node, ornull
if it's a failed node.java.lang.String
toString()
-
-
-
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
-
getName
public java.lang.String getName()
Returns the node name, which is specified inParser.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 java.lang.Object getValue()
Returns the parsed value of this node, ornull
if it's a failed node.
-
getChildren
public java.util.List<ParseTree> getChildren()
Returns the immutable list of child nodes that correspond tolabeled
parsers syntactically enclosed inside parent parser.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-