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