tribble.io
Interface DiagnosticOutputI

All Known Implementing Classes:
DiagnosticOutputDfl

public interface DiagnosticOutputI

Diagnostic message (informational, warning, and error messages) output stream.

This interface is used to implement any kind of output stream that is capable of writing lines of text strings. Such a stream is used to display informational, warning, and error diagnostic messages by such classes as lexical analyzers (lexers) and parsers.

Since:
2001-04-16
Version:
$Revision: 1.2 $ $Date: 2001/07/20 17:28:16 $
Author:
David R. Tribble, david@tribble.com.
Copyright 2001 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.
See Also:
DiagnosticOutputDfl, SuspendablePrintWriter, SuspendableWriterI

Field Summary
static java.lang.String REV
          Revision information.
 
Method Summary
 void printMessage(java.lang.String fname, int line, java.lang.String msg)
          Writes a diagnostic message to the output stream.
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values
Method Detail

printMessage

void printMessage(java.lang.String fname,
                  int line,
                  java.lang.String msg)
Writes a diagnostic message to the output stream. Note that the message string should not contain a terminating linefeed.

Note that this method does not throw any checked exceptions (such as IOException).

Parameters:
fname - An optional source filename for the diagnostic message. If it is not null and not empty, it and a colon (":") immediately following it are written.
line - An optional source line number for the diagnostic message. If it is not zero, it and and a colon (":") immediately following it are written.
msg - The message text. This typically contains a prefix indicating the severity of the message, such as "warning:" or "error:".
Since:
1.1, 2001-04-16