From 82951e37e10b282d9a7c89f4662990b64949c943 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 29 Feb 2016 10:41:17 -0500 Subject: General code cleanup --- .../java/bjc/utils/parserutils/ShuntingYard.java | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java b/BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java index ace636e..8a036ce 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java +++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java @@ -19,7 +19,7 @@ import bjc.utils.funcdata.FunctionalList; */ public class ShuntingYard { - private static enum Operator implements IPrecedent { + public static enum Operator implements IPrecedent { ADD(1), DIVIDE(4), MULTIPLY(3), SUBTRACT(2); private final int precedence; @@ -39,9 +39,6 @@ public class ShuntingYard { } } - static { - } - /** * Holds all the shuntable operations */ @@ -59,6 +56,16 @@ public class ShuntingYard { ops.put("/", Operator.DIVIDE); } + /** + * Add an operator to the list of shuntable operators + * + * @param tok + * The token representing the operator + */ + public void addOp(String tok, int i) { + this.addOp(tok, IPrecedent.newSimplePrecedent(i)); + } + /** * Add an operator to the list of shuntable operators * @@ -127,14 +134,4 @@ public class ShuntingYard { public void removeOp(String tok) { ops.remove(tok); } - - /** - * Add an operator to the list of shuntable operators - * - * @param tok - * The token representing the operator - */ - public void addOp(String tok, int i) { - this.addOp(tok, IPrecedent.newSimplePrecedent(i)); - } } \ No newline at end of file -- cgit v1.2.3