Class AntlrError
java.lang.Object
org.pgcodekeeper.core.ContextLocation
org.pgcodekeeper.core.parsers.antlr.base.AntlrError
- All Implemented Interfaces:
Serializable
Represents an error found during ANTLR parsing with location information
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAntlrError(String location, int line, int charPositionInLine, String msg, ErrorTypes errorType) Creates an ANTLR error without token informationAntlrError(org.antlr.v4.runtime.Token tokenError, String location, int line, int charPositionInLine, String msg) Creates an ANTLR error with default error typeAntlrError(org.antlr.v4.runtime.Token tokenError, String location, int line, int charPositionInLine, String msg, ErrorTypes errorType) Creates an ANTLR error with specified error type -
Method Summary
Methods inherited from class org.pgcodekeeper.core.ContextLocation
equals, getCharPositionInLine, getFilePath, getLineNumber, getOffset, hashCode
-
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 occurredline- 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 occurredline- line number where error occurred (1-based)charPositionInLine- character position in line (0-based)msg- error messageerrorType- 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 occurredline- line number where error occurred (1-based)charPositionInLine- character position in line (0-based)msg- error messageerrorType- type of the error
-
-
Method Details
-
copyWithOffset
Creates a copy of this error with adjusted positions- Parameters:
offset- character offset to addlineOffset- line number offset to addinLineOffset- in-line character position offset to add- Returns:
- new error instance with adjusted positions
-
getMsg
-
getText
-
getStart
public int getStart() -
getStop
public int getStop() -
getErrorType
-
toString
Returns formatted string representation of the error. Converts 0-based char position to 1-based for display.
-