FlatMethod fm=new FlatMethod(td, ffan);
+ HashSet visitedset=new HashSet();
+
for(int i=0;i<td.numParameters();i++) {
VarDescriptor paramvd=td.getParameter(i);
fm.addParameterTemp(getTempforVar(paramvd));
TagExpressionList tel=td.getTag(paramvd);
- HashSet visitedset=new HashSet();
//BUG added next line to fix...to test feed in any task program
if (tel!=null)
for(int j=0;j<tel.numTags();j++) {
TagVarDescriptor tvd=(TagVarDescriptor) td.getParameterTable().getFromSameScope(tel.getName(j));
+ TempDescriptor tagtmp=getTempforVar(tvd);
if (!visitedset.contains(tvd)) {
visitedset.add(tvd);
- TempDescriptor tagtmp=getTempforVar(tvd);
fm.addTagTemp(tagtmp);
- tel.setTemp(j, tagtmp);
}
+ tel.setTemp(j, tagtmp);
}
}
return td;
} else if (d instanceof TagVarDescriptor) {
TagVarDescriptor tvd=(TagVarDescriptor)d;
- TempDescriptor td=TempDescriptor.paramtempFactory(tvd.getName(),tvd.getTag());
+ TypeDescriptor tagtype=new TypeDescriptor(typeutil.getClass(TypeUtil.TagClass));
+ TempDescriptor td=TempDescriptor.paramtempFactory(tvd.getName(), tagtype, tvd.getTag());
temptovar.put(tvd,td);
return td;
} else throw new Error("Unreconized Descriptor");
else {
if (d instanceof VarDescriptor) {
VarDescriptor vd=(VarDescriptor)d;
- TempDescriptor td=TempDescriptor.tempFactory(vd.getName(),vd.getType());
+ TempDescriptor td=TempDescriptor.tempFactory(vd.getName(), vd.getType());
temptovar.put(vd,td);
return td;
} else if (d instanceof TagVarDescriptor) {
TagVarDescriptor tvd=(TagVarDescriptor)d;
- TempDescriptor td=TempDescriptor.tempFactory(tvd.getName(),tvd.getTag());
+ //BUGFIX TAGTYPE - add next line, modify following
+ //line to tag this new type descriptor, modify
+ //TempDescriptor constructor & factory to set type
+ //using this Type To test, use any program with tags
+ TypeDescriptor tagtype=new TypeDescriptor(typeutil.getClass(TypeUtil.TagClass));
+ TempDescriptor td=TempDescriptor.tempFactory(tvd.getName(),tagtype, tvd.getTag());
temptovar.put(tvd,td);
return td;
} else throw new Error("Unrecognized Descriptor");
type=td;
}
- public TempDescriptor(String name, TagDescriptor td) {
+ public TempDescriptor(String name, TypeDescriptor type, TagDescriptor td) {
this(name);
+ this.type=type;
tag=td;
}
return new TempDescriptor(name+currentid,td);
}
- public static TempDescriptor tempFactory(String name, TagDescriptor tag) {
- return new TempDescriptor(name+currentid,tag);
+ public static TempDescriptor tempFactory(String name, TypeDescriptor type, TagDescriptor tag) {
+ return new TempDescriptor(name+currentid,type,tag);
}
public static TempDescriptor paramtempFactory(String name, TypeDescriptor td) {
return new TempDescriptor(name,td);
}
- public static TempDescriptor paramtempFactory(String name, TagDescriptor tag) {
- return new TempDescriptor(name,tag);
+ public static TempDescriptor paramtempFactory(String name, TypeDescriptor tagtype, TagDescriptor tag) {
+ return new TempDescriptor(name, tagtype, tag);
}
public String toString() {
}
public TagExpressionList parseTagExpressionList(ParseNode pn) {
- ParseNodeVector pnv=pn.getChildren();
+ //BUG FIX: change pn.getChildren() to pn.getChild("tag_expression_list").getChildren()
+ //To test, feed in any input program that uses tags
+ ParseNodeVector pnv=pn.getChild("tag_expression_list").getChildren();
TagExpressionList tel=new TagExpressionList();
for(int i=0;i<pnv.size();i++) {
ParseNode tn=pnv.elementAt(i);
void * allocate_new(void *, int type);
struct ArrayObject * allocate_newarray(void *, int type, int length);
struct ___String___ * NewString(void *, const char *str,int length);
+struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
#else
void * allocate_new(int type);
struct ArrayObject * allocate_newarray(int type, int length);
struct ___String___ * NewString(const char *str,int length);
+struct ___TagDescriptor___ * allocate_tag(int index);
#endif
+
+
void initializeexithandler();
void failedboundschk();
void failednullptr();