Class ParseNode

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    ParseUtils.NestedParseNode

    public class ParseNode
    extends java.lang.Object
    implements java.lang.Cloneable
    A parse node.
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseNode()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String createString()
      Creates the match string.
      java.lang.Object getCustomNode()
      Returns the custom node created by parser or rule handler, should there be one.
      <T> T getCustomNode​(java.lang.Class<T> aClass)
      Returns the custom node as the given class type.
      int getEnd()
      Returns the match end.
      Token getEndToken()
      Returns the end token for this node.
      int getLength()
      Returns the match length.
      int getLineIndex()
      Returns the line index.
      java.lang.String getName()
      Returns the rule name.
      Parser getParser()
      Returns the parser.
      java.lang.String getPattern()
      Returns the rule pattern.
      ParseRule getRule()
      Returns the rule.
      int getStart()
      Returns the match start.
      Token getStartToken()
      Returns the start token for this node.
      java.lang.String getString()
      Returns the match string.
      void init​(Parser aParser, ParseRule aRule, Token aStartToken, Token anEndToken)
      Creates a new parse node
      void setCustomNode​(java.lang.Object anObj)
      Sets the custom node created by parser or rule handler, should there be one.
      java.lang.String toString()
      Returns a string representation of node.
      java.lang.String toStringSimple()
      Returns a string representation of node (just .
      • Methods inherited from class java.lang.Object

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

      • ParseNode

        public ParseNode()
    • 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:
        toString in class java.lang.Object
      • toStringSimple

        public java.lang.String toStringSimple()
        Returns a string representation of node (just .