From 126a6c85b60ad07fa29ab48315f0f195fb45d854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gassmann?= Date: Fri, 11 Jun 2021 01:39:49 +0200 Subject: [+] First version of the java calculator --- calculator-java/src/main/java/ch/bfh/Main.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 calculator-java/src/main/java/ch/bfh/Main.java (limited to 'calculator-java/src/main/java/ch/bfh/Main.java') diff --git a/calculator-java/src/main/java/ch/bfh/Main.java b/calculator-java/src/main/java/ch/bfh/Main.java new file mode 100644 index 0000000..b0dedf3 --- /dev/null +++ b/calculator-java/src/main/java/ch/bfh/Main.java @@ -0,0 +1,23 @@ +package ch.bfh; + +import ch.bfh.parser.ExpressionParser; + +import java.util.Arrays; + +public class Main { + + public static void main(String[] args){ + CalculatorLexer cl = new CalculatorLexer(); + + //TODO - command line reader instead of arg + + // Combines the arguments & init the lexer + cl.initLexer( + Arrays.stream(args).reduce("", (expression, arg) -> expression + arg) + ); + + ExpressionParser ep = new ExpressionParser(cl); + + System.out.println(ep.getValue()); + } +} -- cgit v1.2.3