diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-03-27 22:53:08 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-03-27 22:53:08 -0600 |
commit | b01fe1e8e5541d6c11f905d7fbb949d747f29230 (patch) | |
tree | d348b6b471fa2ebb2cece61daaf672c8b27b4299 /st/MethodInstance.java | |
parent | 8131ddc22af5d39114a55349d71bcdc467599187 (diff) |
SymbolTable to separate library, Class/Method Instances
Diffstat (limited to 'st/MethodInstance.java')
-rw-r--r-- | st/MethodInstance.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/st/MethodInstance.java b/st/MethodInstance.java new file mode 100644 index 0000000..c0082af --- /dev/null +++ b/st/MethodInstance.java @@ -0,0 +1,24 @@ +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 + + public MethodInstance(String name, TypeEnum rtrn) { + super(name, TypeEnum.method); + this.args = new ArrayList<>(); + this.rtrn = rtrn; + } + + public String toString() { + return name + ":" + type + "[" + + this.rtrn + "]"; + } + + public void add_argument(TypeEnum arg) { + this.args.add(arg); + } + +} |