1 package Analysis.OoOJava;
8 // The purpose of a ContextTaskNames is to collect the static and
9 // dynamic names for tasks that the context needs to track information
12 // For example, a method might have two tasks defined in different
13 // control branches, either of which may provide a value to a third
14 // task in the context. In this case a dynamic task name should be
15 // saved here so that when the code for the method is generated, a
16 // local variable that points to a task will be declared. Other flat
17 // nodes will have CodePlan objects that will expect the local task
18 // variable name to exist.
20 // There are two types of contexts: methods and task bodies. Here we
21 // don't see the difference because the names of the local variables
22 // generated from these task names should be the same.
25 public class ContextTaskNames {
27 protected Set<SESEandAgePair> needStaticNameInCode;
28 protected Set<TempDescriptor> dynamicVars;
31 public ContextTaskNames() {
32 needStaticNameInCode = new HashSet<SESEandAgePair>();
33 dynamicVars = new HashSet<TempDescriptor>();
37 public void addNeededStaticName( SESEandAgePair p ) {
38 needStaticNameInCode.add( p );
41 public Set<SESEandAgePair> getNeededStaticNames() {
42 return needStaticNameInCode;
45 public void addDynamicVar( TempDescriptor td ) {
46 dynamicVars.add( td );
49 public Set<TempDescriptor> getDynamicVarSet() {