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