diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-25 12:58:10 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-25 12:58:10 -0600 |
commit | c28a1cc9d206bdde41a621b018c01980b3c8a617 (patch) | |
tree | 90e9de370313682558172c8cebac9389b48c0855 /st/AbstractInstance.java | |
parent | bd44adf2b180fcc1198d612a8ae0d2a28468088d (diff) |
Rewrote Symbol Table to be more context aware and avoid collisions
Diffstat (limited to 'st/AbstractInstance.java')
-rw-r--r-- | st/AbstractInstance.java | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/st/AbstractInstance.java b/st/AbstractInstance.java index cdeef8e..a7052a1 100644 --- a/st/AbstractInstance.java +++ b/st/AbstractInstance.java @@ -5,7 +5,6 @@ import java.util.ArrayList; public abstract class AbstractInstance { protected String name; // the literal name of the declaration protected TypeEnum type; // the type of the declaration - protected ClassInstance cls; // the surrounding class public AbstractInstance(String name, TypeEnum type) { this.type = type; @@ -16,18 +15,12 @@ public abstract class AbstractInstance { return this.name; } - public boolean equals(AbstractInstance other) { - return this.name == other.getName() && - this.type == this.type; - } + @Override public abstract boolean equals(Object other); @Override public int hashCode() { return this.name.hashCode(); } - public void addClassInstance(ClassInstance cls) { - this.cls = cls; - } public String getName() { return this.name; @@ -37,8 +30,4 @@ public abstract class AbstractInstance { return this.type; } - public ClassInstance getClassInstance() { - return this.cls; - } - } |