Package org.codehaus.groovy.syntax
Class ParserException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.codehaus.groovy.GroovyException
org.codehaus.groovy.syntax.SyntaxException
org.codehaus.groovy.syntax.TokenException
org.codehaus.groovy.syntax.ParserException
- All Implemented Interfaces:
Serializable,GroovyExceptionInterface
Exception thrown when a parse error is encountered by the parser.
Extends
TokenException to provide token-aware error reporting
with position information from the parse stream.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParserException(String message, Throwable cause, int lineNumber, int columnNumber) Constructs a ParserException with explicit position and a cause.ParserException(String message, Throwable cause, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber) Constructs a ParserException with explicit position range and a cause.ParserException(String message, Token token) Constructs a ParserException from a token and error message. -
Method Summary
Methods inherited from class org.codehaus.groovy.syntax.SyntaxException
getEndColumn, getEndLine, getLine, getMessage, getOriginalMessage, getSourceLocator, getStartColumn, getStartLine, setSourceLocatorMethods inherited from class org.codehaus.groovy.GroovyException
isFatal, setFatalMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParserException
Constructs a ParserException from a token and error message.- Parameters:
message- the error messagetoken- theTokenwhere the error occurred
-
ParserException
Constructs a ParserException with explicit position and a cause.- Parameters:
message- the error messagecause- the underlyingThrowablethat caused this exceptionlineNumber- the line number where the error occurs (1-based)columnNumber- the column number where the error occurs (1-based)
-
ParserException
public ParserException(String message, Throwable cause, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber) Constructs a ParserException with explicit position range and a cause.- Parameters:
message- the error messagecause- the underlyingThrowablethat caused this exceptionlineNumber- the starting line number (1-based)columnNumber- the starting column number (1-based)endLineNumber- the ending line number (1-based)endColumnNumber- the ending column number (1-based)
-