From 98ddff97ec1d092b18ef2d176e83bd92f9671e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gassmann?= Date: Fri, 11 Jun 2021 17:28:55 +0200 Subject: [+] Added StatementParser, [~] Restructured the Parsers --- calculator-java/src/main/java/ch/bfh/parser/Parser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'calculator-java/src/main/java/ch/bfh/parser/Parser.java') diff --git a/calculator-java/src/main/java/ch/bfh/parser/Parser.java b/calculator-java/src/main/java/ch/bfh/parser/Parser.java index 9e048a6..333b942 100644 --- a/calculator-java/src/main/java/ch/bfh/parser/Parser.java +++ b/calculator-java/src/main/java/ch/bfh/parser/Parser.java @@ -3,12 +3,17 @@ package ch.bfh.parser; import ch.bfh.CalculatorLexer; import ch.bfh.Token; +import java.util.HashMap; +import java.util.Map; + abstract class Parser{ + + protected static Map variables = new HashMap<>(); //'Persisted' Expressions when 'let' token was specified + protected CalculatorLexer cl; protected Token lastToken; protected double value; protected abstract void parse(); public abstract double getValue(); -} - +} \ No newline at end of file -- cgit v1.2.3