Package snap.parse
Class ParseNode
java.lang.Object
snap.parse.ParseNode
A parse node.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Creates the match string.Returns the custom node created by parser or rule handler, should there be one.<T> T
getCustomNode
(Class<T> aClass) Returns the custom node as the given class type.int
getEnd()
Returns the match end.Returns the end token for this node.getId()
Returns the id of the node's rule: either the name or pattern or null.int
Returns the match length.int
Returns the line index.getName()
Returns the rule name.Returns the parser.Returns the rule pattern.getRule()
Returns the rule.int
getStart()
Returns the match start.Returns the start token for this node.Returns the match string.void
init
(Parser aParser, ParseRule aRule, ParseToken aStartToken, ParseToken anEndToken) Creates a new parse nodevoid
setCustomNode
(Object anObj) Sets the custom node created by parser or rule handler, should there be one.toString()
Returns a string representation of node.
-
Constructor Details
-
ParseNode
public ParseNode()
-
-
Method Details
-
init
Creates a new parse node -
getParser
Returns the parser. -
getRule
Returns the rule. -
getId
Returns the id of the node's rule: either the name or pattern or null. -
getName
Returns the rule name. -
getPattern
Returns the rule pattern. -
getStartToken
Returns the start token for this node. -
getEndToken
Returns the end token for this node. -
getStart
public int getStart()Returns the match start. -
getEnd
public int getEnd()Returns the match end. -
getLength
public int getLength()Returns the match length. -
getLineIndex
public int getLineIndex()Returns the line index. -
getString
Returns the match string. -
createString
Creates the match string. -
getCustomNode
Returns the custom node created by parser or rule handler, should there be one. -
setCustomNode
Sets the custom node created by parser or rule handler, should there be one. -
getCustomNode
Returns the custom node as the given class type. -
toString
Returns a string representation of node.
-