summaryrefslogtreecommitdiff
path: root/JPratt/src/examples/java/bjc
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2017-04-06 05:46:27 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2017-04-06 05:46:27 -0400
commitee8ab3464bdfe423c8b09b3f9a403899127f1078 (patch)
treebf80416aa42ae6799f0c1f490e18210e86fae0e1 /JPratt/src/examples/java/bjc
parent0b79409b36e0d14ce9c772a728c534dfb9c6f3be (diff)
Add unicode superscripts
Diffstat (limited to 'JPratt/src/examples/java/bjc')
-rw-r--r--JPratt/src/examples/java/bjc/pratt/examples/PrattParserTest.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/JPratt/src/examples/java/bjc/pratt/examples/PrattParserTest.java b/JPratt/src/examples/java/bjc/pratt/examples/PrattParserTest.java
index afb3e40..7e94326 100644
--- a/JPratt/src/examples/java/bjc/pratt/examples/PrattParserTest.java
+++ b/JPratt/src/examples/java/bjc/pratt/examples/PrattParserTest.java
@@ -46,7 +46,9 @@ public class PrattParserTest {
*/
Set<String> ops = new LinkedHashSet<>();
- ops.addAll(Arrays.asList("->"));
+ ops.add("!!!");
+
+ ops.addAll(Arrays.asList("->", "=>"));
ops.add(":=");
ops.addAll(Arrays.asList("||", "&&"));
ops.addAll(Arrays.asList("<=", ">="));
@@ -73,7 +75,7 @@ public class PrattParserTest {
TwoLevelSplitter split = new TwoLevelSplitter();
- split.addCompoundDelim("->");
+ split.addCompoundDelim("->", "=>");
split.addCompoundDelim(":=");
split.addCompoundDelim("||", "&&");
split.addCompoundDelim("<=", ">=");
@@ -84,6 +86,7 @@ public class PrattParserTest {
split.addSimpleDelim("+", "-", "*", "/");
split.addSimpleDelim("^", "!");
+ split.addSimpleMulti("!");
split.addSimpleMulti("\\(", "\\)");
split.addSimpleMulti("\\[", "\\]");
split.addSimpleMulti("\\{", "\\}");
@@ -186,6 +189,8 @@ public class PrattParserTest {
PrattParser<String, String, TestContext> parser = new PrattParser<>();
+ parser.addNonInitialCommand("!!!", postfix(0));
+
parser.addNonInitialCommand(":", infixNon(3));
parser.addNonInitialCommand("if", ternary(5, 0, "else", litToken("cond"), false));