diff --git a/core/src/main/java/org/nwapw/abacus/Abacus.java b/core/src/main/java/org/nwapw/abacus/Abacus.java index 113bda8..6d4907d 100644 --- a/core/src/main/java/org/nwapw/abacus/Abacus.java +++ b/core/src/main/java/org/nwapw/abacus/Abacus.java @@ -1,7 +1,10 @@ package org.nwapw.abacus; import org.nwapw.abacus.config.Configuration; +import org.nwapw.abacus.number.NaiveNumber; import org.nwapw.abacus.number.NumberInterface; +import org.nwapw.abacus.number.PreciseNumber; +import org.nwapw.abacus.number.PromotionManager; import org.nwapw.abacus.parsing.LexerTokenizer; import org.nwapw.abacus.parsing.ShuntingYardParser; import org.nwapw.abacus.parsing.TreeBuilder; @@ -11,6 +14,8 @@ import org.nwapw.abacus.plugin.StandardPlugin; import org.nwapw.abacus.tree.NumberReducer; import org.nwapw.abacus.tree.TreeNode; +import java.math.BigDecimal; + /** * The main calculator class. This is responsible * for piecing together all of the components, allowing @@ -42,6 +47,10 @@ public class Abacus { * from a string. */ private TreeBuilder treeBuilder; + /** + * Promotion manager responsible for the promotion system. + */ + private PromotionManager promotionManager; /** * Creates a new instance of the Abacus calculator. @@ -55,11 +64,20 @@ public class Abacus { LexerTokenizer lexerTokenizer = new LexerTokenizer(); ShuntingYardParser shuntingYardParser = new ShuntingYardParser(); treeBuilder = new TreeBuilder<>(lexerTokenizer, shuntingYardParser); + promotionManager = new PromotionManager(this); pluginManager.addListener(shuntingYardParser); pluginManager.addListener(lexerTokenizer); } + /** + * Gets the promotion manager. + * @return the promotion manager. + */ + public PromotionManager getPromotionManager() { + return promotionManager; + } + /** * Gets the current tree builder. *