- //***Debug Block***
- //FlagDescriptor[] ftemp=(FlagDescriptor[])flags.get(cd);
- //System.out.println("Processing state: "+cd.getSymbol()+" " + fsworking.toString(ftemp));
- //***Debug Block***
-
-
- for(Iterator it_tasks=state.getTaskSymbolTable().getDescriptorsIterator();it_tasks.hasNext();) {
- TaskDescriptor td = (TaskDescriptor)it_tasks.next();
- boolean taskistriggered=false;
- int trigger_ctr=0;
- String taskname=getTaskName(td);
-
-
-
- //***Debug Block***
-
- System.out.println("Method: AnalyseTasks");
- System.out.println(taskname);
- System.out.println();
-
- //***Debug Block***
-
-
-
- for(int i=0; i < td.numParameters(); i++) {
- FlagExpressionNode fen=td.getFlag(td.getParameter(i));
- //if ( (td.getParamType(i).equals(cd))&&(isTaskTrigger(fen,fs))){
- if ((isParamOfSameClass(td.getParamType(i),cd)) && (isTaskTrigger(fen,fs))){
- taskistriggered = true;
- System.out.println(td.getParamType(i).toString()+" "+cd.toString());
- temp=(TempDescriptor)map.get(td.getParameter(i));
- trigger_ctr++;
- }
- }
-
- if (trigger_ctr>1)
- throw new Error("Illegal Operation: A single flagstate cannot satisfy more than one parameter of a task.");
-
- if (taskistriggered) {
- //***Debug Block***
- //
- System.out.println("inside taskistriggered");
-
- //***Debug Block***
-
- taskistriggered=false;
- Adj_List_temp.put(fs,new Vector());
-
- //Iterating through the nodes
- FlatMethod fm = state.getMethodFlat(td);
- FlatNode fn=fm.methodEntryNode();
-
- HashSet tovisit= new HashSet();
- HashSet visited= new HashSet();
-
- tovisit.add(fn);
- while(!tovisit.isEmpty()) {
- FlatNode fn1 = (FlatNode)tovisit.iterator().next();
- tovisit.remove(fn1);
- visited.add(fn1);
- for(int i = 0; i < fn1.numNext(); i++) {
- FlatNode nn=fn1.getNext(i);
- if (nn.kind()==13) {
- //***Debug Block***
- if (((FlatFlagActionNode)nn).getFFANType() == FlatFlagActionNode.PRE) {
- throw new Error("PRE FlagActions not supported");
-
- } else if (((FlatFlagActionNode)nn).getFFANType() == FlatFlagActionNode.NEWOBJECT) {
- //***Debug Block***
- System.out.println("NEWObject");
- //***Debug Block***
-
- q_retval.offer(evalNewObjNode(nn));
-
-
-
- // ****debug block********
- // System.out.println("/***********contents of q ret **********/");
- /* for (Iterator it_qret=q_retval.iterator();it_qret.hasNext();) {
- TriggerState ts_qret=(TriggerState)it_qret.next();
- FlagState fs_qret=ts_qret.getState();
-
- System.out.println("FS : "+fs_qret.toString((FlagDescriptor [])flags.get(ts_qret.getClassDescriptor())));
- }*/
- // ****debug block********
-
- }
- if (((FlatFlagActionNode)nn).getFFANType() == FlatFlagActionNode.TASKEXIT) {
- //***Debug Block***
- //
- System.out.println("TaskExit");
- //***Debug Block***
- FlagState fs_taskexit=evalTaskExitNode(nn,cd,fs);
-
-
-
- if (!edgeexists(Adj_List_temp,fs,fs_taskexit,taskname)) {
- ((Vector)Adj_List_temp.get(fs)).add(new Edge(fs_taskexit,taskname));
- }
- if ((!wasFlagStateProcessed(Adj_List_temp,fs_taskexit)) && (!existsInQMain(fs_taskexit)) && (!existsInQ(q_retval,fs_taskexit))){
- q_retval.offer(fs_taskexit);
- }
- }
- }
-
- if (!visited.contains(nn) && !tovisit.contains(nn)) {
- tovisit.add(nn);
- }
- }