Update of /cvsroot/nice/Nice/src/nice/tools/compiler/console
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1598/src/nice/tools/compiler/console
Modified Files:
listener.nice
Log Message:
Make the nicec ant task report messages through the ant framework.
Index: listener.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/console/listener.nice,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** listener.nice 14 Jun 2003 14:20:38 -0000 1.2
--- listener.nice 20 Feb 2004 02:51:57 -0000 1.3
***************
*** 21,39 ****
public ConsoleOutput consoleOutput() = new ConsoleOutput();
! let int OK = 0; // Normal exit (compilation sucessful, version message)
! let int BUG = 1; // Abnormal termination (bug in the compiler)
! let int ERROR = 2; // Error reported (file missing, type error, ...)
! let int WARNING = 3; // Warning reported
!
! public final class ConsoleOutput implements CompilationListener
{
- public int statusCode = OK;
-
- private void setStatusCode(int status)
- {
- if (worse(status, statusCode))
- statusCode = status;
- }
-
progress(packageName, phase)
{
--- 21,26 ----
public ConsoleOutput consoleOutput() = new ConsoleOutput();
! public final class ConsoleOutput extends StatusCodeListener
{
progress(packageName, phase)
{
***************
*** 51,55 ****
warning(location, message)
{
! this.setStatusCode(WARNING);
if (location != null)
System.out.println("\n" + location + ":\n" + message);
--- 38,42 ----
warning(location, message)
{
! super;
if (location != null)
System.out.println("\n" + location + ":\n" + message);
***************
*** 60,64 ****
error(location, message)
{
! this.setStatusCode(ERROR);
if (location != null)
System.err.println("\n" + location + ":\n" + message);
--- 47,51 ----
error(location, message)
{
! super;
if (location != null)
System.err.println("\n" + location + ":\n" + message);
***************
*** 70,74 ****
bug(stackTrace, url)
{
! this.setStatusCode(BUG);
System.err.println
("\nAn exception has occured in the compiler\n" +
--- 57,61 ----
bug(stackTrace, url)
{
! super;
System.err.println
("\nAn exception has occured in the compiler\n" +
***************
*** 79,89 ****
}
}
-
- boolean worse(int status, int than)
- {
- if (than == OK) return true;
- if (than == BUG) return false;
- if (than == ERROR) return false;
- if (than == WARNING) return status == BUG || status == ERROR;
- return false;
- }
--- 66,67 ----
|