summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/parserutils
diff options
context:
space:
mode:
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/parserutils')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/parserutils/IPrecedent.java28
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java1
2 files changed, 28 insertions, 1 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/parserutils/IPrecedent.java b/BJC-Utils2/src/main/java/bjc/utils/parserutils/IPrecedent.java
new file mode 100644
index 0000000..95ced43
--- /dev/null
+++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/IPrecedent.java
@@ -0,0 +1,28 @@
+package bjc.utils.parserutils;
+
+/**
+ * Represents something that has a set precedence
+ *
+ * @author ben
+ *
+ */
+@FunctionalInterface
+public interface IPrecedent {
+ /**
+ * Create a new object with set precedence
+ *
+ * @param prec
+ * The precedence of the object to handle
+ * @return A new object with set precedence
+ */
+ public static IPrecedent newSimplePrecedent(int prec) {
+ return () -> prec;
+ }
+
+ /**
+ * Get the precedence of the attached object
+ *
+ * @return The precedence of the attached object
+ */
+ public int getPrecedence();
+} \ No newline at end of file
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 3ce7da0..3bb6bed 100644
--- a/BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java
+++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/ShuntingYard.java
@@ -7,7 +7,6 @@ import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
-import bjc.utils.data.IPrecedent;
import bjc.utils.funcdata.FunctionalList;
import bjc.utils.funcutils.StringUtils;