Generalize definition of SumExpr a little...Lets sum all elements of
[repair.git] / Repair / RepairCompiler / MCC / IR / SetDescriptor.java
index 6bd62eda75108f9670520867a9c664759f41c033..c461537da3b6fc5ef0d590720342938873ce6c9f 100755 (executable)
@@ -12,6 +12,7 @@ public class SetDescriptor extends Descriptor {
     TypeDescriptor type;
     boolean partition;
     Vector subsets;       
+    public static String prefix="";
 
     public SetDescriptor(String name) {
         super(name);
@@ -22,17 +23,18 @@ public class SetDescriptor extends Descriptor {
     public static Set expand(Set descriptors) {
         HashSet expanded = new HashSet();
         Iterator d = descriptors.iterator();
-        
+
         while (d.hasNext()) {
             Descriptor descriptor = (Descriptor) d.next();
             
             if (descriptor instanceof SetDescriptor) {
                 expanded.addAll(((SetDescriptor) descriptor).allSubsets());
-            }
+            } else
+               expanded.add(descriptor); /* Still need the descriptor */
         }
 
         expanded.addAll(descriptors);
-        return expanded;        
+        return expanded;
     }
 
     public boolean isPartition() {
@@ -90,4 +92,10 @@ public class SetDescriptor extends Descriptor {
         return v;
     }        
 
+    public String getSafeSymbol() {
+       return prefix+safename;
+    }
+    public String getJustSafeSymbol() {
+       return safename;
+    }
 }