Class ParseNode
- java.lang.Object
-
- com.inductiveautomation.snap.parse.ParseNode
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
ParseUtils.NestedParseNode
public class ParseNode extends java.lang.Object implements java.lang.CloneableA parse node.
-
-
Constructor Summary
Constructors Constructor Description ParseNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcreateString()Creates the match string.java.lang.ObjectgetCustomNode()Returns the custom node created by parser or rule handler, should there be one.<T> TgetCustomNode(java.lang.Class<T> aClass)Returns the custom node as the given class type.intgetEnd()Returns the match end.TokengetEndToken()Returns the end token for this node.intgetLength()Returns the match length.intgetLineIndex()Returns the line index.java.lang.StringgetName()Returns the rule name.ParsergetParser()Returns the parser.java.lang.StringgetPattern()Returns the rule pattern.ParseRulegetRule()Returns the rule.intgetStart()Returns the match start.TokengetStartToken()Returns the start token for this node.java.lang.StringgetString()Returns the match string.voidinit(Parser aParser, ParseRule aRule, Token aStartToken, Token anEndToken)Creates a new parse nodevoidsetCustomNode(java.lang.Object anObj)Sets the custom node created by parser or rule handler, should there be one.java.lang.StringtoString()Returns a string representation of node.java.lang.StringtoStringSimple()Returns a string representation of node (just .
-
-
-
Method Detail
-
init
public void init(Parser aParser, ParseRule aRule, Token aStartToken, Token anEndToken)
Creates a new parse node
-
getParser
public Parser getParser()
Returns the parser.
-
getRule
public ParseRule getRule()
Returns the rule.
-
getName
public java.lang.String getName()
Returns the rule name.
-
getPattern
public java.lang.String getPattern()
Returns the rule pattern.
-
getStartToken
public Token getStartToken()
Returns the start token for this node.
-
getEndToken
public Token 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
public java.lang.String getString()
Returns the match string.
-
createString
protected java.lang.String createString()
Creates the match string.
-
getCustomNode
public java.lang.Object getCustomNode()
Returns the custom node created by parser or rule handler, should there be one.
-
setCustomNode
public void setCustomNode(java.lang.Object anObj)
Sets the custom node created by parser or rule handler, should there be one.
-
getCustomNode
public <T> T getCustomNode(java.lang.Class<T> aClass)
Returns the custom node as the given class type.
-
toString
public java.lang.String toString()
Returns a string representation of node.- Overrides:
toStringin classjava.lang.Object
-
toStringSimple
public java.lang.String toStringSimple()
Returns a string representation of node (just .
-
-