aboutsummaryrefslogtreecommitdiff
path: root/calculator-java/src/main/java/ch/bfh/Main.java
diff options
context:
space:
mode:
authorMaël Gassmann <mael.gassmann@students.bfh.ch>2021-06-11 17:28:55 +0200
committerMaël Gassmann <mael.gassmann@students.bfh.ch>2021-06-11 17:28:55 +0200
commit98ddff97ec1d092b18ef2d176e83bd92f9671e03 (patch)
treeaf1457e05063421dc2860e6c033e58b28f9a8e4e /calculator-java/src/main/java/ch/bfh/Main.java
parent49f30529d9cd2ed62902079a45d4d3c1f45afbda (diff)
[+] Added StatementParser, [~] Restructured the Parsers
Diffstat (limited to 'calculator-java/src/main/java/ch/bfh/Main.java')
-rw-r--r--calculator-java/src/main/java/ch/bfh/Main.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/calculator-java/src/main/java/ch/bfh/Main.java b/calculator-java/src/main/java/ch/bfh/Main.java
index e57fc8a..5dc8a91 100644
--- a/calculator-java/src/main/java/ch/bfh/Main.java
+++ b/calculator-java/src/main/java/ch/bfh/Main.java
@@ -1,25 +1,25 @@
package ch.bfh;
-import ch.bfh.parser.ExpressionParser;
+import ch.bfh.parser.StatementParser;
+
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
+ StatementParser sp = new StatementParser();
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());
+ sp.parseStatement(expression);
+ System.out.println(sp.getValue());
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
-}
+} \ No newline at end of file