Package sc.parser

Class ErrorParseNode

  • All Implemented Interfaces:
    java.lang.CharSequence, java.lang.Cloneable, IParseNode, IParseResult
    Direct Known Subclasses:
    PreErrorParseNode

    public class ErrorParseNode
    extends AbstractParseNode
    Represents an error in the parse-node tree that was parsed. The errorText may be the empty string if the error does not correspond to any actual text in the document (i.e. it represents something missing like a semicolon).
    • Constructor Detail

      • ErrorParseNode

        public ErrorParseNode​(ParseError err,
                              java.lang.String errText)
    • Method Detail

      • getSemanticValue

        public java.lang.Object getSemanticValue()
      • setSemanticValue

        public void setSemanticValue​(java.lang.Object value,
                                     boolean clearOld,
                                     boolean restore)
      • toDebugString

        public java.lang.String toDebugString()
      • refersToSemanticValue

        public boolean refersToSemanticValue​(java.lang.Object v)
      • firstChar

        public int firstChar()
        Description copied from interface: IParseNode
        Returns the first character value produced or -1 if there is none
      • updateSemanticValue

        public void updateSemanticValue​(java.util.IdentityHashMap<java.lang.Object,​java.lang.Object> oldNewMap)
      • computeLineNumberForNode

        public void computeLineNumberForNode​(LineFormatContext ctx,
                                             IParseNode toFindPN)
        Description copied from interface: IParseNode
        Internal method used to walk the parse tree to find the line number for a given parse node (which must be in the tree).
      • findStartDiff

        public void findStartDiff​(DiffContext ctx,
                                  boolean atEnd,
                                  java.lang.Object parSemVal,
                                  ParentParseNode parSemNode,
                                  int childIx)
        Description copied from interface: IParseNode
        Finds the first parse node whose text does not match the DiffContext
      • findEndDiff

        public void findEndDiff​(DiffContext ctx,
                                java.lang.Object parSemVal,
                                ParentParseNode parParseNode,
                                int childIx)
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object
      • getErrorMessage

        public java.lang.String getErrorMessage()
      • getErrorText

        public java.lang.String getErrorText()
      • isGeneratedTree

        public boolean isGeneratedTree()
        Description copied from interface: IParseNode
        Returns true if any nodes in this tree have been through the 'generate' process. These nodes might have formatting parse nodes that need to be replaced for some operations
      • addParseErrors

        public void addParseErrors​(java.util.List<ParseError> res,
                                   int max)
        Description copied from interface: IParseNode
        For incremental parses, return the list of errors detected and continued in the parse-stream (useful for syntax highlighting)