package MCC.IR;
-
+import MCC.Compiler;
import java.util.*;
public class SetInclusion extends Inclusion {
public String generatedresult = null;
public String generatedaddeditem = null;
- static boolean worklist = false;
+ public static boolean worklist = false;
public boolean dostore = true;
+ public String toString() {
+ String str="";
+ str+=elementexpr.name()+" in "+set;
+ return str;
+ }
+
public SetInclusion(Expr elementexpr, SetDescriptor set) {
this.elementexpr = elementexpr;
this.set = set;
return elementexpr.usesDescriptor(d);
}
+ public Expr getExpr() {
+ return elementexpr;
+ }
+
public SetDescriptor getSet() {
return set;
}
// we set equal to one so that if dostore == false the guard in teh
// metainclusion generation for the subrules and sub quantifiers will go on
- writer.outputline("int " + addeditem + " = 1;");
- if (dostore) {
-
- writer.outputline(addeditem + " = " + set.getSafeSymbol() + "_hash->add((int)" + vd.getSafeSymbol()
- + ", (int)" + vd.getSafeSymbol() + ");");
+ if (dostore) {
+ /* if (!Compiler.REPAIR) {
+ writer.outputline("int " + addeditem + " = 1;");
+ writer.outputline(addeditem + " = " + set.getSafeSymbol() + "_hash->add((int)" + vd.getSafeSymbol()
+ + ", (int)" + vd.getSafeSymbol() + ");");
+ } else {*/
+ Repair.generate_dispatch(writer, set, vd.getSafeSymbol());
+ // }
+
if (SetInclusion.worklist) {
writer.outputline("if (" + addeditem + ")");
writer.startblock(); {
}
writer.endblock();
}
-
- }
-
+ }
}
public boolean typecheck(SemanticAnalyzer sa) {