|
1 |
| package edu.rice.cs.dynamicjava.interpreter; |
|
2 |
| |
|
3 |
| import java.io.PrintWriter; |
|
4 |
| |
|
5 |
| import edu.rice.cs.plt.lambda.Lambda; |
|
6 |
| import koala.dynamicjava.interpreter.error.ExecutionError; |
|
7 |
| import koala.dynamicjava.tree.SourceInfo; |
|
8 |
| |
|
9 |
| public class CheckerException extends InterpreterException implements SourceInfo.Wrapper { |
|
10 |
| |
|
11 |
47
| public CheckerException(ExecutionError cause) {
|
|
12 |
47
| super(cause);
|
|
13 |
| } |
|
14 |
| |
|
15 |
47
| public void printUserMessage(PrintWriter out) {
|
|
16 |
47
| out.print("Static Error: ");
|
|
17 |
47
| out.println(getCause().getMessage());
|
|
18 |
| } |
|
19 |
| |
|
20 |
0
| public SourceInfo getSourceInfo() {
|
|
21 |
0
| return ((ExecutionError) getCause()).getNode().getSourceInfo();
|
|
22 |
| } |
|
23 |
| |
|
24 |
| public static final Lambda<ExecutionError, CheckerException> FACTORY = |
|
25 |
| new Lambda<ExecutionError, CheckerException>() { |
|
26 |
0
| public CheckerException value(ExecutionError e) { return new CheckerException(e); }
|
|
27 |
| }; |
|
28 |
| |
|
29 |
| } |