public class Main extends Object
| Constructor and Description |
|---|
Main() |
| Modifier and Type | Method and Description |
|---|---|
static int |
evaluate(String input)
Call on the default interpreter interface to evaluate an expression
|
static boolean |
handleInput(String input)
Evaluate the input, catching exceptions as needed, and printing appropriate messages.
|
static void |
main(String[] args) |
static boolean |
shouldExit(String input)
Determines whether input contained a request to quit the program
|
public static int evaluate(String input) throws TokenizerException, ParserException, EvaluatorException
input - expression to evaluateTokenizerException - bad tokens (illegal characters) in inputEvaluatorException - error such as division by zeroParserException - syntax error in expressionpublic static boolean shouldExit(String input)
input - the input from the user to be evalulatedshouldExitshouldExitpublic static boolean handleInput(String input)
Evaluate the input, catching exceptions as needed, and printing appropriate messages.
input - the input from the user to be evalulatedshouldExitshouldExitpublic static void main(String[] args)