diff options
| author | EVE <EVE@EVE-PC> | 2017-03-14 12:08:11 -0400 |
|---|---|---|
| committer | EVE <EVE@EVE-PC> | 2017-03-14 12:08:11 -0400 |
| commit | 635d3150e3e85c01b777ff165e21fa8965d58440 (patch) | |
| tree | 3389128f83a5a79f8d0eec0a0e19f54b9d117b66 /dice-lang/src/bjc/dicelang/Node.java | |
| parent | e59e2a97773f93bdd25bd4680809c10699f0feb3 (diff) | |
Cleanup
Diffstat (limited to 'dice-lang/src/bjc/dicelang/Node.java')
| -rw-r--r-- | dice-lang/src/bjc/dicelang/Node.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/dice-lang/src/bjc/dicelang/Node.java b/dice-lang/src/bjc/dicelang/Node.java index 15ae66e..df966ba 100644 --- a/dice-lang/src/bjc/dicelang/Node.java +++ b/dice-lang/src/bjc/dicelang/Node.java @@ -12,10 +12,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(Type typ) { type = typ; @@ -45,8 +45,9 @@ public class Node { resultVal = res; } + @Override public String toString() { - switch (type) { + switch(type) { case UNARYOP: case BINOP: return "(" + type.name() + " : " + operatorType + ")"; @@ -62,16 +63,15 @@ public class Node { } } + @Override public boolean equals(Object other) { - if (!(other instanceof Node)) - return false; + if(!(other instanceof Node)) return false; Node otk = (Node) other; - if (otk.type != type) - return false; + if(otk.type != type) return false; - switch (type) { + switch(type) { case OGROUP: return tokenVal.equals(otk.tokenVal); default: |
