protected boolean isinvokedbystatic; // flag to indicate if this method is invoked by some static block
protected boolean isdefaultconstructor; // flag to indicate if this is a default constructor
+
+ private int lineNum;
+
public MethodDescriptor(Modifiers m, TypeDescriptor rt, String identifier) {
super(identifier);
TypeDescriptor td1=(d1 instanceof TagVarDescriptor)?((TagVarDescriptor)d1).getType():((VarDescriptor)d1).getType();
TypeDescriptor td2=(d2 instanceof TagVarDescriptor)?((TagVarDescriptor)d2).getType():((VarDescriptor)d2).getType();
if (!td1.equals(td2))
- return false;
+ return false;
}
return true;
}
for(int i=0; i<numParameters(); i++) {
st+=getParamType(i).getSafeDescriptor();
if ((i+1)<numParameters())
- st+="_";
+ st+="_";
}
return st;
}
else throw new Error();
}
+ public String getSafeSymbol() {
+ return safename.replace(".","___________").replace("$","___DOLLAR___");
+ }
+
public String toString() {
String st="";
String type="";
for(int i=0; i<params.size(); i++) {
st+=getParamType(i)+" "+getParamName(i);
if ((i+1)!=params.size())
- st+=", ";
+ st+=", ";
}
st+=")";
return st;
public void setDefaultConstructor() {
this.isdefaultconstructor = true;
}
+
+ public String getMethodDeclaration(){
+ String st="";
+ String type="";
+ if (returntype != null)
+ st = modifier.toString() + returntype.toString() + " " + type + identifier + "(";
+ else
+ st = modifier.toString() + identifier + "(";
+ for (int i = 0; i < params.size(); i++) {
+ st += getParamType(i) + " " + getParamName(i);
+ if ((i + 1) != params.size())
+ st += ", ";
+ }
+ st += ")";
+ return st;
+ }
+
+ public void setLineNum(int n){
+ lineNum=n;
+ }
+
+ public int getLineNum(){
+ return lineNum;
+ }
+
}