public SetExpr(SetDescriptor sd) {
this.sd = sd;
}
-
+
+ public String name() {
+ return sd.toString();
+ }
+
+ public boolean equals(Map remap, Expr e) {
+ if (e==null||!(e instanceof SetExpr))
+ return false;
+ SetExpr se=(SetExpr)e;
+ if (sd!=se.sd)
+ return false;
+ return true;
+ }
+
+ public boolean usesDescriptor(Descriptor s) {
+ return (s==sd);
+ }
+
+ public Set useDescriptor(Descriptor s) {
+ HashSet newset=new HashSet();
+ if (s==sd)
+ newset.add(this);
+ return newset;
+ }
+
public SetExpr() {
this.sd = null;
}
}
public void generate_inclusion(CodeWriter writer, VarDescriptor dest, VarDescriptor element) {
- writer.outputline("int " + dest.getSafeSymbol() + " = " + sd.getSafeSymbol() + "_hash->contains(" + element.getSafeSymbol() + ");");
- }
+ writer.outputline("int " + dest.getSafeSymbol() + " = SimpleHashcontainskey(" +sd.getSafeSymbol()+ "_hash, "+element.getSafeSymbol() + ");");
+ }
public void generate_size(CodeWriter writer, VarDescriptor dest) {
- writer.outputline("int " + dest.getSafeSymbol() + " = " + sd.getSafeSymbol() + "_hash->count();");
+ writer.outputline("int " + dest.getSafeSymbol() + " = SimpleHashcountset("+sd.getSafeSymbol()+"_hash);");
}
public void prettyPrint(PrettyPrinter pp) {
}
}
-
-