5 public class SetExpr extends Expr {
9 public SetExpr(SetDescriptor sd) {
17 public Set getInversedRelations() {
21 public Set getRequiredDescriptors() {
22 HashSet v = new HashSet();
27 public void generate(CodeWriter writer, VarDescriptor dest) {
28 throw new IRException("unsupported");
31 public void generate_inclusion(CodeWriter writer, VarDescriptor dest, VarDescriptor element) {
32 writer.outputline("int " + dest.getSafeSymbol() + " = " + sd.getSafeSymbol() + "_hash->contains(" + element.getSafeSymbol() + ");");
35 public void generate_size(CodeWriter writer, VarDescriptor dest) {
36 writer.outputline("int " + dest.getSafeSymbol() + " = " + sd.getSafeSymbol() + "_hash->count();");
39 public void prettyPrint(PrettyPrinter pp) {
40 pp.output(sd.getSafeSymbol());
43 public TypeDescriptor typecheck(SemanticAnalyzer sa) {
44 this.td = sd.getType();