diff options
author | Maël Gassmann <mael.gassmann@students.bfh.ch> | 2021-06-11 01:39:49 +0200 |
---|---|---|
committer | Maël Gassmann <mael.gassmann@students.bfh.ch> | 2021-06-11 01:39:49 +0200 |
commit | 126a6c85b60ad07fa29ab48315f0f195fb45d854 (patch) | |
tree | 1c0245fc232c701da8577a5451d703a0d5808822 /calculator-java/src/main/java/ch/bfh/Main.java | |
parent | ee369b50b14ffe662e05355459f57c076680cd58 (diff) |
[+] First version of the java calculator
Diffstat (limited to 'calculator-java/src/main/java/ch/bfh/Main.java')
-rw-r--r-- | calculator-java/src/main/java/ch/bfh/Main.java | 23 |
1 files changed, 23 insertions, 0 deletions
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()); + } +} |