diff --git a/core/src/main/java/org/nwapw/abacus/Abacus.java b/core/src/main/java/org/nwapw/abacus/Abacus.java index 826f266..113bda8 100644 --- a/core/src/main/java/org/nwapw/abacus/Abacus.java +++ b/core/src/main/java/org/nwapw/abacus/Abacus.java @@ -53,7 +53,7 @@ public class Abacus { numberReducer = new NumberReducer(this); this.configuration = new Configuration(configuration); LexerTokenizer lexerTokenizer = new LexerTokenizer(); - ShuntingYardParser shuntingYardParser = new ShuntingYardParser(this); + ShuntingYardParser shuntingYardParser = new ShuntingYardParser(); treeBuilder = new TreeBuilder<>(lexerTokenizer, shuntingYardParser); pluginManager.addListener(shuntingYardParser); diff --git a/core/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java b/core/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java index 86684ce..c792463 100644 --- a/core/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java +++ b/core/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java @@ -1,6 +1,5 @@ package org.nwapw.abacus.parsing; -import org.nwapw.abacus.Abacus; import org.nwapw.abacus.function.Operator; import org.nwapw.abacus.function.OperatorAssociativity; import org.nwapw.abacus.function.OperatorType; @@ -17,10 +16,6 @@ import java.util.*; */ public class ShuntingYardParser implements Parser>, PluginListener { - /** - * The Abacus instance used to create number instances. - */ - private Abacus abacus; /** * Map of operator precedences, loaded from the plugin operators. */ @@ -35,12 +30,9 @@ public class ShuntingYardParser implements Parser>, PluginListe private Map typeMap; /** - * Creates a new Shunting Yard parser with the given Abacus instance. - * - * @param abacus the abacus instance. + * Creates a new Shunting Yard parser. */ - public ShuntingYardParser(Abacus abacus) { - this.abacus = abacus; + public ShuntingYardParser() { precedenceMap = new HashMap<>(); associativityMap = new HashMap<>(); typeMap = new HashMap<>();