From f441022881945db08846e09a8f3bfee2f8cfa95d Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 15 Jun 2016 21:56:03 +0300 Subject: Add interpreter and AST --- main/exception/InterpreterException.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'main/exception/InterpreterException.java') 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 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; -- cgit v1.3