diff options
| author | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-03-01 10:13:41 -0500 |
|---|---|---|
| committer | bjculkin <bjculkin@WIT-136XG42.wvu-ad.wvu.edu> | 2017-03-01 10:13:41 -0500 |
| commit | 36e0911c6ec27707a74f0b90b1052a16374243ea (patch) | |
| tree | 08ca7723b0c0a6a7f3ce1830c59e5211e46168b8 /dice-lang/src/bjc/dicelang/v2/Node.java | |
| parent | 6ed83507953322c35a456d64d89f8f4f9cb0a6a1 (diff) | |
Package reorganization
Diffstat (limited to 'dice-lang/src/bjc/dicelang/v2/Node.java')
| -rw-r--r-- | dice-lang/src/bjc/dicelang/v2/Node.java | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/dice-lang/src/bjc/dicelang/v2/Node.java b/dice-lang/src/bjc/dicelang/v2/Node.java deleted file mode 100644 index 334a9f3..0000000 --- a/dice-lang/src/bjc/dicelang/v2/Node.java +++ /dev/null @@ -1,82 +0,0 @@ -package bjc.dicelang.v2; - -public class Node { - public static enum Type { - ROOT, TOKREF, - UNARYOP, BINOP, - GROUP, OGROUP, - RESULT - } - - public static enum GroupType { - ARRAY, CODE - } - - 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 Node(Type typ) { - type = typ; - } - - public Node(Type typ, Token tokenVl) { - this(typ); - - tokenVal = tokenVl; - } - - public Node(Type typ, Token.Type opType) { - this(typ); - - operatorType = opType; - } - - public Node(Type typ, GroupType grupType) { - this(typ); - - groupType = grupType; - } - - public Node(Type typ, EvaluatorResult res) { - this(typ); - - resultVal = res; - } - - public String toString() { - switch(type) { - 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; - } - } - - public boolean equals(Object other) { - if(!(other instanceof Node)) return false; - - Node otk = (Node)other; - - if(otk.type != type) return false; - - switch(type) { - case OGROUP: - return tokenVal.equals(otk.tokenVal); - default: - return true; - } - } -} |
