Fix the bug of assignment conversion: 'short s = 12' should be allowed. And for such...
[IRC.git] / Robust / src / IR / Tree / LiteralNode.java
index 9c64184cbe5b671792e233fe48212dfe60a7bff5..e975c19ed865f16c41b7b94decf2821b2c245172 100644 (file)
@@ -60,4 +60,12 @@ public class LiteralNode extends ExpressionNode {
   public int kind() {
     return Kind.LiteralNode;
   }
+  
+  public Long evaluate() {
+    eval = null;
+    if(this.type.isChar() || this.type.isInt()) { 
+      eval = Long.parseLong(this.value.toString());
+    }
+    return eval;
+  }
 }