Class AntlrError

java.lang.Object
org.pgcodekeeper.core.ContextLocation
org.pgcodekeeper.core.database.base.parser.AntlrError
All Implemented Interfaces:
Serializable

public class AntlrError extends ContextLocation
Represents an error found during ANTLR parsing with location information
See Also:
  • Constructor Details

    • AntlrError

      public AntlrError(org.antlr.v4.runtime.Token tokenError, String location, int line, int charPositionInLine, String msg)
      Creates an ANTLR error with default error type
      Parameters:
      tokenError - the token where error occurred (may be null)
      location - file path where error occurred
      line - line number where error occurred (1-based)
      charPositionInLine - character position in line (0-based)
      msg - error message
    • AntlrError

      public AntlrError(org.antlr.v4.runtime.Token tokenError, String location, int line, int charPositionInLine, String msg, ErrorTypes errorType)
      Creates an ANTLR error with specified error type
      Parameters:
      tokenError - the token where error occurred (may be null)
      location - file path where error occurred
      line - line number where error occurred (1-based)
      charPositionInLine - character position in line (0-based)
      msg - error message
      errorType - type of the error
    • AntlrError

      public AntlrError(String location, int line, int charPositionInLine, String msg, ErrorTypes errorType)
      Creates an ANTLR error without token information
      Parameters:
      location - file path where error occurred
      line - line number where error occurred (1-based)
      charPositionInLine - character position in line (0-based)
      msg - error message
      errorType - type of the error
  • Method Details

    • copyWithOffset

      public AntlrError copyWithOffset(int offset, int lineOffset, int inLineOffset)
      Creates a copy of this error with adjusted positions
      Parameters:
      offset - character offset to add
      lineOffset - line number offset to add
      inLineOffset - in-line character position offset to add
      Returns:
      new error instance with adjusted positions
    • getMsg

      public String getMsg()
    • getText

      public String getText()
    • getStart

      public int getStart()
    • getStop

      public int getStop()
    • getErrorType

      public ErrorTypes getErrorType()
    • toString

      public String toString()
      Returns formatted string representation of the error. Converts 0-based char position to 1-based for display.
      Overrides:
      toString in class Object
      Returns:
      formatted error string with location info