Fix some of Dan's bugs (code generation for relation quantifiers misstyped), didn...
[repair.git] / Repair / RepairCompiler / MCC / IR / Expr.java
1 package MCC.IR;
2
3 import java.util.*;
4
5 public abstract class Expr {
6     
7     TypeDescriptor td = null;
8
9     public Expr() {}
10     /* Remap this's variables using the remap mapping */
11     public abstract boolean equals(Map remap, Expr e);
12
13     public abstract Set getRequiredDescriptors();
14
15     public abstract void generate(CodeWriter writer, VarDescriptor dest);
16
17     public TypeDescriptor getType() {
18         assert td != null : toString();
19         return td;
20     }
21
22     public String name() {
23         System.out.println(this.getClass().getName());
24         return "?";
25     }
26
27     public abstract TypeDescriptor typecheck(SemanticAnalyzer sa);
28
29     public abstract void prettyPrint(PrettyPrinter pp);
30
31     public Set getInversedRelations() {
32         throw new IRException("unsupported");
33     }
34
35     public DNFRule constructDNF() {
36         return new DNFRule(this);
37     }
38
39     public Descriptor getDescriptor() {
40         return null;
41     }
42
43     public int[] getRepairs(boolean negated) {
44         System.out.println(this.getClass().getName());
45         throw new Error("Unrecognized EXPR");
46     }
47
48     public boolean inverted() {
49         return false;
50     }
51
52     public boolean usesDescriptor(Descriptor rd) {
53         System.out.println(this.getClass().getName());
54         throw new Error("UNIMPLEMENTED");
55     }
56
57 }