X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FIR%2FSetInclusion.java;h=51a5113844a1b3147cc6640c67c7679e623ae5af;hb=202f42f08243277d9c252e6560f8366780c5478b;hp=cdf67b238585600140462842b981807bc39c46d8;hpb=30816378d0198b3cdeac43ad5bf80df3b7646406;p=repair.git diff --git a/Repair/RepairCompiler/MCC/IR/SetInclusion.java b/Repair/RepairCompiler/MCC/IR/SetInclusion.java index cdf67b2..51a5113 100755 --- a/Repair/RepairCompiler/MCC/IR/SetInclusion.java +++ b/Repair/RepairCompiler/MCC/IR/SetInclusion.java @@ -1,5 +1,5 @@ package MCC.IR; - +import MCC.Compiler; import java.util.*; public class SetInclusion extends Inclusion { @@ -10,9 +10,15 @@ 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; @@ -25,6 +31,10 @@ public class SetInclusion extends Inclusion { return elementexpr.usesDescriptor(d); } + public Expr getExpr() { + return elementexpr; + } + public SetDescriptor getSet() { return set; } @@ -51,13 +61,17 @@ public class SetInclusion extends Inclusion { // 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(); { @@ -65,9 +79,7 @@ public class SetInclusion extends Inclusion { } writer.endblock(); } - - } - + } } public boolean typecheck(SemanticAnalyzer sa) {