summaryrefslogtreecommitdiff
path: root/dice-lang/src/bjc/dicelang/Node.java
diff options
context:
space:
mode:
authorBenjamin J. Culkin <bjculkin@mix.wvu.edu>2017-07-23 22:58:58 -0300
committerBenjamin J. Culkin <bjculkin@mix.wvu.edu>2017-07-23 22:58:58 -0300
commitc74cb8eaf454d9243b75e3770001d8d128356b28 (patch)
tree899197afc0b7c382aa37c778053357e0e9b56c26 /dice-lang/src/bjc/dicelang/Node.java
parent57f9a3bfdad20bead5b35ee540e8790e80a6b9a4 (diff)
Format
Diffstat (limited to 'dice-lang/src/bjc/dicelang/Node.java')
-rw-r--r--dice-lang/src/bjc/dicelang/Node.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/dice-lang/src/bjc/dicelang/Node.java b/dice-lang/src/bjc/dicelang/Node.java
index af26870..af69c8c 100644
--- a/dice-lang/src/bjc/dicelang/Node.java
+++ b/dice-lang/src/bjc/dicelang/Node.java
@@ -13,10 +13,10 @@ public class Node {
public final Type type;
// These can have or not have values based of the node type
- public Token tokenVal;
- public Token.Type operatorType;
- public GroupType groupType;
- public EvaluatorResult resultVal;
+ public Token tokenVal;
+ public Token.Type operatorType;
+ public GroupType groupType;
+ public EvaluatorResult resultVal;
public Node(final Type typ) {
type = typ;
@@ -52,13 +52,17 @@ public class Node {
case UNARYOP:
case BINOP:
return "(" + type.name() + " : " + operatorType + ")";
+
case OGROUP:
case TOKREF:
return "(" + type.name() + " : " + tokenVal + ")";
+
case GROUP:
return "(" + type.name() + " : " + groupType + ")";
+
case RESULT:
return "(" + type.name() + " : " + resultVal + ")";
+
default:
return "Unknown node type " + type;
}
@@ -75,6 +79,7 @@ public class Node {
switch (type) {
case OGROUP:
return tokenVal.equals(otk.tokenVal);
+
default:
return true;
}