package IR; import IR.Tree.FlagExpressionNode; import IR.Tree.TagExpressionList; import IR.Tree.FlagEffects; import java.util.Vector; import java.util.Hashtable; import java.util.Iterator; import IR.Tree.Modifiers; /** * Descriptor * */ public class TaskDescriptor extends Descriptor { protected Hashtable flagstable; protected Hashtable tagstable; protected Vector vfe; protected String identifier; protected Vector params; protected Vector optionals; protected SymbolTable paramtable; public TaskDescriptor(String identifier) { super(identifier); this.identifier=identifier; this.uniqueid=count++; flagstable=new Hashtable(); tagstable=new Hashtable(); //BUGFIX - added initialization here params=new Vector(); optionals = new Vector(); paramtable=new SymbolTable(); } public void addFlagEffects(Vector vfe) { this.vfe=vfe; } public Vector getFlagEffects() { return vfe; } public SymbolTable getParameterTable() { return paramtable; } public void addParameter(TypeDescriptor type, String paramname, FlagExpressionNode fen, TagExpressionList tel, boolean isoptional) { if (paramname.equals("this")) throw new Error("Can't have parameter named this"); VarDescriptor vd=new VarDescriptor(type, paramname); params.add(vd); if (isoptional) optionals.add(vd); if (fen!=null) flagstable.put(vd, fen); if (tel!=null) {//BUGFIX - added null check here...test with any bristlecone program tagstable.put(vd, tel); for(int i=0;i