//============================================================================== // tribble/io/DiagnosticOutputI.java //------------------------------------------------------------------------------ package tribble.io; // System imports import java.lang.String; // Local imports // (None) /******************************************************************************* * 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. * * @version $Revision: 1.2 $ $Date: 2001/07/20 17:28:16 $ * @since 2001-04-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 DiagnosticOutputDfl * @see SuspendablePrintWriter * @see SuspendableWriterI */ public interface DiagnosticOutputI { // Identification /** Revision information. */ static final String REV = "@(#)tribble/io/DiagnosticOutputI.java $Revision: 1.2 $ $Date: 2001/07/20 17:28:16 $\n"; // Public methods /*************************************************************************** * 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 * {@link java.io.IOException}). * * @param 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. * * @param 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. * * @param 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 */ public void printMessage(String fname, int line, String msg); } // End DiagnosticOutputI.java