Changes for William's Analysis
[IRC.git] / Robust / src / Analysis / TaskStateAnalysis / EGTaskNode.java
1 package Analysis.TaskStateAnalysis;
2 import Analysis.TaskStateAnalysis.*;
3 import IR.*;
4 import IR.Tree.*;
5 import IR.Flat.*;
6 import java.util.*;
7 import Util.GraphNode;
8
9 public class EGTaskNode extends TaskNode {
10     private boolean source=false;
11     private int loopmarker=0;
12     private boolean multipleparams=false;
13     private boolean optional = false;
14     private boolean marked=false;
15     private boolean tomention=true;
16     private int type = 0;
17     private FlagState fs;
18     private TaskDescriptor td;
19     
20     public EGTaskNode(){
21         super("default");
22         this.fs = null;
23         this.td = null;
24     }
25     
26     public EGTaskNode(String name){
27         super(name);
28         this.fs = null;
29         this.td = null;
30     }
31
32     public EGTaskNode(String name, FlagState fs){
33         super(name);
34         this.fs = fs;
35         this.td = null;
36     }
37
38     public EGTaskNode(String name, TaskDescriptor td){
39         super(name);
40         this.fs = null;
41         this.td = td;
42     }
43
44     public EGTaskNode(String name, FlagState fs, TaskDescriptor td){
45         super(name);
46         this.fs = fs;
47         this.td = td;
48     }
49
50     public TaskDescriptor getTD(){
51         return td;
52     }
53         
54     public void setSource(){
55         source = true;
56     }
57
58     public boolean isSource(){
59         return source;
60     }
61
62     public int getuid(){
63         return uid;
64     }
65
66     public void doSelfLoopMarking(){
67         loopmarker=1;
68     }
69
70     public void doLoopMarking(){
71         loopmarker=2;
72     }
73             
74     public boolean isSelfLoop(){
75         if (loopmarker==1) return true;
76         else return false;
77     }
78
79     public boolean isLoop(){
80         if (loopmarker==2) return true;
81         else return false;
82     }
83
84     public void setMultipleParams(){
85         multipleparams=true;
86     }
87
88     public boolean isMultipleParams(){
89         return multipleparams;
90     }
91     
92     public void setOptional(){
93         optional = true;
94     }
95
96     public boolean isOptional(){
97         return optional;
98     }
99
100     public void mark(){
101         marked = true;
102     }
103
104     public void unMark(){
105         marked = false;
106     }
107     
108     public boolean isMarked(){
109         return marked;
110     }
111
112     public String getFSName(){
113         if(fs == null) return "no flag";
114         else return fs.getTextLabel();
115     }
116     
117     public FlagState getFS(){
118         return fs;
119     }
120
121     public void dontMention(){
122         tomention = false;
123     }
124
125     public boolean toMention(){
126         return tomention;
127     }
128     
129     public void setAND(){
130         type = 1;
131     }
132     
133     public void setOR(){
134         type = 0;
135     }
136     
137     public int type(){
138         return type;
139     }
140     
141
142 }