diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2016-06-13 23:16:54 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2016-07-26 19:46:50 +0300 |
| commit | 12eeefcdba1ee392f033f51e6b9826eaae3c4de6 (patch) | |
| tree | 061f3472bfc924dfa05b46f3aeab76b788b86914 /main/exception/ExceptionManager.java | |
| parent | 560e490ea44970edca22181cc2726f0b2ebb82c9 (diff) | |
Add tokenizer, parser and support for certain operations
Diffstat (limited to 'main/exception/ExceptionManager.java')
| -rw-r--r-- | main/exception/ExceptionManager.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/main/exception/ExceptionManager.java b/main/exception/ExceptionManager.java new file mode 100644 index 0000000..0ceb25b --- /dev/null +++ b/main/exception/ExceptionManager.java @@ -0,0 +1,29 @@ +package com.jantuomi.interpreter.main.exception; + +import java.util.List; + +/** + * Created by jan on 10.6.2016. + */ +public class ExceptionManager { + + private static final ExceptionManager instance = new ExceptionManager(); + + private ExceptionManager() { + } + + public static ExceptionManager getInstance() { + return instance; + } + + public static void raise(InterpreterException.Exception ex, int line, List<String> args) { + InterpreterException e = new InterpreterException(ex); + String output = e.what(); + for (String arg : args) { + output = String.format(output, arg); + } + System.err.println(String.format("[%s] line: %d %s", ex.toString(), line, output)); + } + + +} |
