Package org.apache.groovy.parser.antlr4
Class GroovySyntaxError
java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.AssertionError
org.apache.groovy.parser.antlr4.GroovySyntaxError
- All Implemented Interfaces:
Serializable
Represents a syntax error of a Groovy program, raised by the lexer or parser.
The message is the diagnostic as produced by the recogniser (for example
Unclosed string literal or Unexpected character: '\u200b').
Line and column are 1-based caret coordinates. On the compiler's normal lexer
path (SyntaxErrorReportable.require(boolean, java.lang.String, int, boolean) with toAttachPositionInfo
false), the location is not part of the message string —
SyntaxException appends
@ line N, column M when wrapping the error. The public
SyntaxErrorReportable.throwSyntaxError(java.lang.String, int, boolean) path can still append
PositionInfo when toAttachPositionInfo is true (IDE /
highlighter callers).
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGroovySyntaxError(String message, int source, int line, int column) Creates an error with no cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
LEXER
public static final int LEXERsourcevalue for an error raised by the lexer.- See Also:
-
PARSER
public static final int PARSERsourcevalue for an error raised by the parser.- See Also:
-
-
Constructor Details
-
GroovySyntaxError
-
-
Method Details
-
getSource
public int getSource()Returns the recogniser that raised this error. -
getLine
public int getLine()Returns the line passed to the constructor.- Returns:
- the stored line
-
getColumn
public int getColumn()Returns the column passed to the constructor.- Returns:
- the stored column
-