summaryrefslogtreecommitdiff
path: root/st/MethodInstance.java
diff options
context:
space:
mode:
Diffstat (limited to 'st/MethodInstance.java')
-rw-r--r--st/MethodInstance.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/st/MethodInstance.java b/st/MethodInstance.java
index c0082af..11b233b 100644
--- a/st/MethodInstance.java
+++ b/st/MethodInstance.java
@@ -3,22 +3,29 @@ package st;
import java.util.ArrayList;
public class MethodInstance extends AbstractInstance {
- private ArrayList<TypeEnum> args; // the list of arguments
- private TypeEnum rtrn; // the returned type
+ private ArrayList<TypeInstance> args; // the list of arguments
+ private ArrayList<TypeInstance> lvars; // the list of local variables
+ private TypeEnum rtrn; // the returned type
public MethodInstance(String name, TypeEnum rtrn) {
super(name, TypeEnum.method);
+ this.lvars = new ArrayList<>();
this.args = new ArrayList<>();
this.rtrn = rtrn;
}
public String toString() {
- return name + ":" + type + "[" +
- this.rtrn + "]";
+ return name + ":T[" + type + "]R[" +
+ this.rtrn + "]P[" + this.args.toString() +
+ "]V[" + this.lvars.toString() + "]";
}
- public void add_argument(TypeEnum arg) {
- this.args.add(arg);
+ public void set_args(ArrayList<TypeInstance> args) {
+ this.args = args;
+ }
+
+ public void set_locals(ArrayList<TypeInstance> lvars) {
+ this.lvars = lvars;
}
}