KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > util > InternalCompilerError


1 package polyglot.util;
2
3 /** Exception thrown when the compiler is confused. */
4 public class InternalCompilerError extends RuntimeException JavaDoc
5 {
6     Position pos;
7
8     public InternalCompilerError(String JavaDoc msg) {
9         this(msg, (Position)null);
10     }
11
12     public InternalCompilerError(Throwable JavaDoc cause) {
13         this(cause.getMessage(), cause);
14     }
15
16     public InternalCompilerError(String JavaDoc msg, Throwable JavaDoc cause) {
17         this(msg, null, cause);
18     }
19
20     public InternalCompilerError(Position position, String JavaDoc msg) {
21     this(msg, position);
22     }
23
24     public InternalCompilerError(String JavaDoc msg, Position position) {
25         super(msg);
26         pos = position;
27     }
28     public InternalCompilerError(String JavaDoc msg, Position position, Throwable JavaDoc cause) {
29         super(msg, cause);
30         pos = position;
31     }
32
33     public Position position() {
34     return pos;
35     }
36
37     public String JavaDoc message() {
38     return super.getMessage();
39     }
40
41     public String JavaDoc getMessage() {
42     return pos == null ? message() : pos + ": " + message();
43     }
44 }
45
Popular Tags