summaryrefslogtreecommitdiff
path: root/st/MethodInstance.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-06 21:10:55 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-06 21:10:55 -0600
commitbb8d3aff71f8f89bed2ab94f382675a2312b1893 (patch)
treeaea71a22ad5a893083feebb661a50a413f4f0049 /st/MethodInstance.java
parent8e660afb356c1f6d0b9cd115426cf21129e5d304 (diff)
Add test file, fix minor issues in SymbolTable
Diffstat (limited to 'st/MethodInstance.java')
-rw-r--r--st/MethodInstance.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/st/MethodInstance.java b/st/MethodInstance.java
index 25096d2..c7df92f 100644
--- a/st/MethodInstance.java
+++ b/st/MethodInstance.java
@@ -6,7 +6,6 @@ public class MethodInstance extends AbstractInstance {
private ArrayList<TypeInstance> args; // the list of arguments
private ArrayList<TypeInstance> lvars; // the list of local variables
private TypeEnum rtrn; // the returned type
- private ClassInstance scope; // the surrounding class
public MethodInstance(String name, TypeEnum rtrn) {
super(name, TypeEnum.method);
@@ -15,12 +14,20 @@ public class MethodInstance extends AbstractInstance {
this.rtrn = rtrn;
}
- public void addArgument(TypeInstance arg) {
+ public ArrayList<TypeInstance> getArguments() {
+ return this.args;
+ }
+
+ public ArrayList<TypeInstance> getLocals() {
+ return this.lvars;
+ }
+
+ protected void addArgument(TypeInstance arg) {
this.args.add(arg);
this.lvars.add(arg);
}
- public void addLocal(TypeInstance lvar) {
+ protected void addLocal(TypeInstance lvar) {
this.lvars.add(lvar);
}