From c28a1cc9d206bdde41a621b018c01980b3c8a617 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Thu, 25 Apr 2024 12:58:10 -0600 Subject: Rewrote Symbol Table to be more context aware and avoid collisions --- st/AbstractInstance.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'st/AbstractInstance.java') 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; - } - } -- cgit v1.2.3