Class SyntaxErrorMessage

java.lang.Object
org.codehaus.groovy.control.messages.Message
org.codehaus.groovy.control.messages.SyntaxErrorMessage

public class SyntaxErrorMessage extends Message
A class for error messages produced by the parser system.
  • Field Details

    • cause

      protected SyntaxException cause
      Underlying syntax exception.
    • source

      protected SourceUnit source
      Source unit containing the syntax error.
  • Constructor Details

    • SyntaxErrorMessage

      public SyntaxErrorMessage(SyntaxException cause, SourceUnit source)
      Creates a message for the supplied syntax error.
      Parameters:
      cause - the syntax exception to report
      source - the source unit containing the error
  • Method Details

    • getCause

      public SyntaxException getCause()
      Returns the underlying SyntaxException.
    • toDiagnostic

      public Diagnostic toDiagnostic()
      The error's bare text with its position: SyntaxException.getMessage() appends " @ line N, column M.", which the position fields already carry.
      Overrides:
      toDiagnostic in class Message
      Returns:
      the diagnostic view, never null
    • write

      public void write(PrintWriter output, Janitor janitor)
      Writes out a nicely formatted summary of the syntax error.
      Specified by:
      write in class Message