From b01fe1e8e5541d6c11f905d7fbb949d747f29230 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Wed, 27 Mar 2024 22:53:08 -0600 Subject: SymbolTable to separate library, Class/Method Instances --- st/MethodInstance.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 st/MethodInstance.java (limited to 'st/MethodInstance.java') 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 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); + } + +} -- cgit v1.2.3