diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2016-06-15 21:56:03 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2016-07-26 19:46:51 +0300 |
| commit | f441022881945db08846e09a8f3bfee2f8cfa95d (patch) | |
| tree | 3b565c6902e5b5b6c351df89fe1d58b00d79f091 /main/exception/InterpreterException.java | |
| parent | 12eeefcdba1ee392f033f51e6b9826eaae3c4de6 (diff) | |
Add interpreter and AST
Diffstat (limited to 'main/exception/InterpreterException.java')
| -rw-r--r-- | main/exception/InterpreterException.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/main/exception/InterpreterException.java b/main/exception/InterpreterException.java index 8129012..6ba5a7b 100644 --- a/main/exception/InterpreterException.java +++ b/main/exception/InterpreterException.java @@ -10,15 +10,19 @@ import java.util.Map; public class InterpreterException { public enum Exception { - IllegalTokenException, - UnknownOperatorException + IllegalTokenError, + UnknownOperatorError, + SyntaxError, + TypeError } public static Map<Exception, String> errorTexts = new HashMap<>(); static { - errorTexts.put(Exception.IllegalTokenException, "Illegal token %s found."); - errorTexts.put(Exception.UnknownOperatorException, "Unknown operator %s found."); + errorTexts.put(Exception.IllegalTokenError, "Illegal token %s found."); + errorTexts.put(Exception.UnknownOperatorError, "Unexpected operator %s found."); + errorTexts.put(Exception.SyntaxError, "Unexpected %s."); + errorTexts.put(Exception.TypeError, "Incompatible types %s and %s."); } private Exception exception; |
