5 public class ImageSetExpr extends SetExpr {
7 public static final boolean INVERSE = true;
10 RelationDescriptor rd;
13 public ImageSetExpr(VarDescriptor vd, RelationDescriptor rd) {
19 public ImageSetExpr(boolean inverse, VarDescriptor vd, RelationDescriptor rd) {
22 this.inverse = inverse;
25 public Set getRequiredDescriptors() {
26 HashSet v = new HashSet();
31 public void generate(CodeWriter writer, VarDescriptor dest) {
32 throw new IRException("not supported");
35 public void generate_inclusion(CodeWriter writer, VarDescriptor dest, VarDescriptor element) {
36 String hash = inverse ? "_hashinv->contains(" : "_hash->contains(" ;
37 writer.outputline("int " + dest.getSafeSymbol() + " = " + rd.getSafeSymbol() + hash + vd.getSafeSymbol() + ", " + element.getSafeSymbol() + ");");
40 public void generate_size(CodeWriter writer, VarDescriptor dest) {
44 String hash = inverse ? "_hashinv->count(" : "_hash->count(" ;
45 writer.outputline("int " + dest.getSafeSymbol() + " = " + rd.getSafeSymbol() + hash + vd.getSafeSymbol() + ");");
48 public void prettyPrint(PrettyPrinter pp) {
49 throw new IRException("not supported");
52 public TypeDescriptor typecheck(SemanticAnalyzer sa) {
53 throw new IRException("not supported");