diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-03-31 23:23:06 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-03-31 23:23:06 -0600 |
commit | 35b1ec663c4bf233c1beba823d2c2ebd2759289e (patch) | |
tree | dec867cc6e12f587e87aeb9eea0f7640e0b78d68 /st/ClassInstance.java | |
parent | 23b6f865aad683d7f3590c46aa4b74f0a030f6af (diff) |
Partial implementation of full class definition storing in SymTable
Diffstat (limited to 'st/ClassInstance.java')
-rw-r--r-- | st/ClassInstance.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/st/ClassInstance.java b/st/ClassInstance.java index 44b41c9..8b49236 100644 --- a/st/ClassInstance.java +++ b/st/ClassInstance.java @@ -11,7 +11,7 @@ public class ClassInstance extends AbstractInstance { super(name, TypeEnum.classname); this.attrs = new ArrayList<>(); this.mtds = new ArrayList<>(); - this.ext = null; + this.ext = ""; } public ClassInstance(String name, String ext) { @@ -20,20 +20,18 @@ public class ClassInstance extends AbstractInstance { } public String toString() { - return this.name + ":" + this.type + "(" + - this.ext + ")"; - } + return name + ":T[" + type + "]E[" + + this.ext + "]A[" + this.attrs.toString() + + "]";//M[" + this.mtds.toString() + "]"; - public void add_attribute(TypeInstance attr) { - this.attrs.add(attr); } - public void add_attribute(MethodInstance mtd) { - this.mtds.add(mtd); + public void set_attrs(ArrayList<TypeInstance> attrs) { + this.attrs = attrs; } - public String get_extend() { - return this.ext; + public void set_mtds(ArrayList<MethodInstance> mtds) { + this.mtds = mtds; } } |