projects
/
IRC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix the bug of assignment conversion: 'short s = 12' should be allowed. And for such...
[IRC.git]
/
Robust
/
src
/
IR
/
Tree
/
LiteralNode.java
diff --git
a/Robust/src/IR/Tree/LiteralNode.java
b/Robust/src/IR/Tree/LiteralNode.java
index 9c64184cbe5b671792e233fe48212dfe60a7bff5..e975c19ed865f16c41b7b94decf2821b2c245172 100644
(file)
--- a/
Robust/src/IR/Tree/LiteralNode.java
+++ b/
Robust/src/IR/Tree/LiteralNode.java
@@
-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;
+ }
}