summaryrefslogtreecommitdiff
path: root/st/MethodInstance.java
blob: 8b4ed5715879505452350bbe0ed782f3aa4c8989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package st;

import java.util.ArrayList;

public class MethodInstance extends AbstractInstance {
    private ArrayList<String> args;             // the list of arguments
    private ArrayList<String> 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 + ":T[" + type + "]R[" +
            this.rtrn + "]P[" + this.args.toString() +
            "]V[" + this.lvars.toString() + "]";
    }

    public void set_args(ArrayList<String> args) {
        this.args = args;
    }

    public void set_locals(ArrayList<String> lvars) {
        this.lvars = lvars;
    }

}