2 // report.cs: report errors and warnings.
4 // Author: Miguel de Icaza (miguel@ximian.com)
6 // (C) 2001 Ximian, Inc. (http://www.ximian.com)
18 public void RealError (string msg)
21 Console.WriteLine (msg);
24 throw new Exception (msg);
27 public void Error (int code, Location l, string text)
29 string msg = l.Name + "(" + l.Row + "," + l.Col +
30 "): Error CS"+code+": " + text;
35 public void Warning (int code, Location l, string text)
37 Console.WriteLine (l.Name + "(" + l.Row + "," + l.Col +
38 "): Warning CS"+code+": " + text);
42 public void Error (int code, string text)
44 string msg = "Error CS"+code+": "+text;
49 public void Warning (int code, string text)
51 Console.WriteLine ("Warning CS"+code+": "+text);
55 public void Message (Message m)
57 if (m is ErrorMessage)
58 Error (m.code, m.text);
60 Warning (m.code, m.text);
86 public class Message {
90 public Message (int code, string text)
97 public class WarningMessage : Message {
98 public WarningMessage (int code, string text) : base (code, text)
103 public class ErrorMessage : Message {
104 public ErrorMessage (int code, string text) : base (code, text)
109 // For compatibility reasons with old code.
111 public static void report_error (string error)
113 Console.Write ("ERROR: ");
114 Console.WriteLine (error);