diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-25 00:35:18 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-25 00:35:18 -0600 |
commit | bd44adf2b180fcc1198d612a8ae0d2a28468088d (patch) | |
tree | 943261bdab0abcba47388c0ec594a6b84d839102 /st/AbstractInstance.java | |
parent | 765337c53286db39ffc3c64eede602afe3899647 (diff) |
Basic support for 'extended' classes in SymbolTable
Diffstat (limited to 'st/AbstractInstance.java')
-rw-r--r-- | st/AbstractInstance.java | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/st/AbstractInstance.java b/st/AbstractInstance.java index 6db9d3c..cdeef8e 100644 --- a/st/AbstractInstance.java +++ b/st/AbstractInstance.java @@ -5,13 +5,11 @@ 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 ArrayList<AbstractInstance> scope; // the scope where the instance is valid protected ClassInstance cls; // the surrounding class public AbstractInstance(String name, TypeEnum type) { this.type = type; this.name = name; - this.scope = new ArrayList<>(); } @Override public String toString() { @@ -27,21 +25,6 @@ public abstract class AbstractInstance { return this.name.hashCode(); } - public void setScope(AbstractInstance ins) { - /** - * If the scope is a MethodInstance, add the single method. - * If the scope is a ClassInstance, add the classes' methods, - * and the class itself. - */ - // FIXME add third pass to properly add all scope information - if (ins instanceof MethodInstance) - this.scope.add(ins); - else if (ins instanceof ClassInstance) { - for (MethodInstance mtd : ((ClassInstance) ins).getMethods()) - this.scope.add(mtd); - } - } - public void addClassInstance(ClassInstance cls) { this.cls = cls; } @@ -54,10 +37,6 @@ public abstract class AbstractInstance { return this.type; } - public ArrayList<AbstractInstance> getScope() { - return this.scope; - } - public ClassInstance getClassInstance() { return this.cls; } |