summaryrefslogtreecommitdiff
path: root/st/TokenKey.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-05-09 00:36:50 -0600
committerbd-912 <bdunahu@colostate.edu>2024-05-09 00:36:50 -0600
commitf86e714a4fdebb994101813a5fa6664f5883a0ab (patch)
tree727bec17afbb6fc373d6a6b73a69ba47ad1b7a4c /st/TokenKey.java
parentf59241de07bfc0170fe3a18dc279d2a66bd58fdb (diff)
Many final bug-fixes in heat visitor, symbol table
Diffstat (limited to 'st/TokenKey.java')
-rw-r--r--st/TokenKey.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/st/TokenKey.java b/st/TokenKey.java
index 948e06a..a421c95 100644
--- a/st/TokenKey.java
+++ b/st/TokenKey.java
@@ -10,18 +10,21 @@ import misc.*;
public class TokenKey {
private String name;
+ private TypeEnum type;
private AbstractInstance cls; // null for classes
private AbstractInstance mtd; // null for classes, methods
- public TokenKey(String name, AbstractInstance cls, AbstractInstance mtd) {
+ public TokenKey(String name, TypeEnum type, AbstractInstance cls, AbstractInstance mtd) {
this.name = name;
+ this.type = type;
this.cls = cls;
this.mtd = mtd;
}
@Override public String toString() {
- return String.format("%s (%s,%s)",
+ return String.format("%s of %s (%s,%s)",
this.name,
+ this.type,
this.mtd,
this.cls);
}
@@ -47,6 +50,8 @@ public class TokenKey {
// }
if (other instanceof TokenKey &&
(o = (TokenKey) other).name.equals(this.name) &&
+ ((o.type == null && this.type == null) ||
+ (o.type != null && o.type.equals(this.type))) &&
((o.cls == null && this.cls == null) ||
(o.cls != null && o.cls.equals(this.cls))) &&
((o.mtd == null && this.mtd == null) ||