package ch.bfh; import ch.bfh.parser.ExpressionParser; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); while (true) { CalculatorLexer cl = new CalculatorLexer(); System.out.print("Type your expression: "); String expression = scanner.nextLine(); try { cl.initLexer(expression); ExpressionParser ep = new ExpressionParser(cl); System.out.println(ep.getValue()); } catch (Exception e) { System.out.println(e.getMessage()); } } } }