org.inxar.syntacs.translator
Interface Complaint

All Known Implementing Classes:
StandardAuditor.StandardComplaint

public interface Complaint

Complaint is a general name for a semantic/syntactic warnings and errors.


Field Summary
static int LEXICAL_ERROR
          Type constant for a lexical error.
static int SEMANTIC_ERROR
          Type constant for a semantic error.
static int SEMANTIC_WARNING
          Type constant for a semantic warning.
static int SYNTACTIC_ERROR
          Type constant for a syntactic error.
static int UNSPECIFIED_ERROR
          Type constant for a nonspecific error.
 
Method Summary
 int getLineNumber()
          Returns the line number of the error or -1 if it is not known.
 String getMessage()
          Returns a message describing this complaint.
 String getSource()
          Returns the name of the source file/URI/whatever or null if it is not known.
 int getType()
          Returns the type of this Complaint as one of the constants in this interface.
 void printMessage()
          Prints a trace of the Complaint to System.out.
 void printMessage(PrintStream out)
          Identical to printMessage() with the exception that output is written to the given PrintStream rather than System.out.
 

Field Detail

SEMANTIC_ERROR

public static final int SEMANTIC_ERROR
Type constant for a semantic error. Semantic errors represent logical problems which are generally unrecoverable.

SEMANTIC_WARNING

public static final int SEMANTIC_WARNING
Type constant for a semantic warning. Semantic warnings represent logical issues which are generally recoverable.

LEXICAL_ERROR

public static final int LEXICAL_ERROR
Type constant for a lexical error.

SYNTACTIC_ERROR

public static final int SYNTACTIC_ERROR
Type constant for a syntactic error.

UNSPECIFIED_ERROR

public static final int UNSPECIFIED_ERROR
Type constant for a nonspecific error.
Method Detail

getType

public int getType()
Returns the type of this Complaint as one of the constants in this interface.

getSource

public String getSource()
Returns the name of the source file/URI/whatever or null if it is not known.

getLineNumber

public int getLineNumber()
Returns the line number of the error or -1 if it is not known. The first line is 1, there is no line zero.

getMessage

public String getMessage()
Returns a message describing this complaint.

printMessage

public void printMessage()
Prints a trace of the Complaint to System.out. The printMessage() and getMessage() operations are different in that printMessage() will synthesize a formatted output that may include all the other data (source URI, line number, etc...) whereas getMessage() will only return the message string. The contract is analogous to the printStackTrace() and getMessage() methods in the Throwable heirarchy.

printMessage

public void printMessage(PrintStream out)
Identical to printMessage() with the exception that output is written to the given PrintStream rather than System.out.