2 import IR.Tree.Modifiers;
3 import IR.Tree.ExpressionNode;
4 import java.util.Vector;
9 * represents a symbol in the language (var name, function name, etc).
12 public class MethodDescriptor extends Descriptor {
14 protected Modifiers modifier;
15 protected TypeDescriptor returntype;
16 protected String identifier;
17 protected Vector param_name;
18 protected Vector param_type;
20 public MethodDescriptor(Modifiers m, TypeDescriptor rt, String identifier) {
24 this.identifier=identifier;
25 this.safename = "__" + name + "__";
26 this.uniqueid=count++;
27 param_name=new Vector();
28 param_type=new Vector();
30 public void addParameter(TypeDescriptor type, String paramname) {
31 param_name.add(paramname);
35 public String toString() {
36 String st=modifier.toString()+returntype.toString()+" "+identifier+"(";
37 for(int i=0;i<param_type.size();i++) {
38 st+=param_type.get(i).toString()+" "+param_name.get(i).toString();
39 if ((i+1)!=param_type.size())