Class GroovySyntaxError

java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.AssertionError
org.apache.groovy.parser.antlr4.GroovySyntaxError
All Implemented Interfaces:
Serializable

public class GroovySyntaxError extends AssertionError
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 Details

  • Constructor Details

    • GroovySyntaxError

      public GroovySyntaxError(String message, int source, int line, int column)
  • Method Details

    • getSource

      public int getSource()
    • getLine

      public int getLine()
    • getColumn

      public int getColumn()