|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface should be used by all classes that perform
parsing functions to write compiler-style errors.
It is a set of standard error printing functions.
Classes that generate the errors should use specify the column numbers
if possible, as it makes the errors easier to understand.
I would recommend that implementors use the
StringHelp.underliner()
to implement the
*AtLineNumber functions.
Method Summary | |
void |
printError(java.lang.String message)
Print an error. |
void |
printError(java.lang.String message,
int start,
int stop)
Print an error at a specific place inside the current line. |
void |
printErrorAtLineNumber(java.lang.String message,
int lineNum)
Print an error at a a specific line number. |
void |
printErrorTotals()
Print out the error count totals, usually in the form x Errors, y Warnings, z General Errors |
void |
printGeneralError(java.lang.String message)
Prints an error that is unconnected to a line number. |
void |
printWarning(java.lang.String message)
Print an warning. |
void |
printWarning(java.lang.String message,
int start,
int stop)
Print an warning at a specific place inside the current line. |
void |
printWarningAtLineNumber(java.lang.String message,
int lineNum)
Print an warning at a a specific line number. |
void |
setOutput(java.io.PrintWriter pw)
Specify where to send the output. |
Method Detail |
public void setOutput(java.io.PrintWriter pw)
pw
- A PrintWriter associated with the proper stream.public void printError(java.lang.String message, int start, int stop)
message
- the message to print with the errorstart
- the column where the error beginsstop
- the column where the error endspublic void printError(java.lang.String message)
message
- the message to print with the errorprintError(String message, int start, int stop)
public void printErrorAtLineNumber(java.lang.String message, int lineNum)
message
- The message to print with the error.lineNum
- The line where the error occured.public void printWarning(java.lang.String message, int start, int stop)
message
- the message to print with the warningstart
- the column where the questionable part beginsstop
- the column where the questionable part endspublic void printWarning(java.lang.String message)
message
- the message to print with the warningpublic void printWarningAtLineNumber(java.lang.String message, int lineNum)
message
- the message to print with the warninglineNum
- The line where the error occured.public void printGeneralError(java.lang.String message)
message
- the message to print with the warningpublic void printErrorTotals()
x Errors, y Warnings, z General Errors
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |