From c2feedee3210b0f2b6c0739b8dfae953fc33f778 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 25 Aug 2017 19:49:37 -0700 Subject: [PATCH] Register precedences of TreeValue operators. --- .../java/org/nwapw/abacus/parsing/ShuntingYardParser.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 fd74bc0..7490d96 100644 --- a/core/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java +++ b/core/src/main/java/org/nwapw/abacus/parsing/ShuntingYardParser.java @@ -189,6 +189,12 @@ public class ShuntingYardParser implements Parser>, PluginListe associativityMap.put(operator, operatorInstance.getAssociativity()); typeMap.put(operator, operatorInstance.getType()); } + for (String operator : manager.getAllTreeValueOperators()) { + Operator operatorInstance = manager.treeValueOperatorFor(operator); + precedenceMap.put(operator, operatorInstance.getPrecedence()); + associativityMap.put(operator, operatorInstance.getAssociativity()); + typeMap.put(operator, operatorInstance.getType()); + } } @Override