summaryrefslogtreecommitdiff
path: root/st/AbstractInstance.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-15 15:19:54 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-15 15:19:54 -0600
commit04e9109f112f4cb7317416c2e31806f42663cb45 (patch)
tree9ae99f2bc5d5fbb41d731792b1d22a30f2e642b3 /st/AbstractInstance.java
parent056690e0e60d4d0ce046c171691aa02a7071eeae (diff)
Allow MethodInstance to keep track of parent class
Diffstat (limited to 'st/AbstractInstance.java')
-rw-r--r--st/AbstractInstance.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/st/AbstractInstance.java b/st/AbstractInstance.java
index d236044..7214e6a 100644
--- a/st/AbstractInstance.java
+++ b/st/AbstractInstance.java
@@ -6,6 +6,7 @@ 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;
@@ -41,6 +42,10 @@ public abstract class AbstractInstance {
}
}
+ protected void addClassInstance(ClassInstance cls) {
+ this.cls = cls;
+ }
+
public String getName() {
return this.name;
}
@@ -53,4 +58,8 @@ public abstract class AbstractInstance {
return this.scope;
}
+ public ClassInstance getClassInstance() {
+ return this.cls;
+ }
+
}