310e5ae96c2b06ef9148c0535869e9db6dd07a95
[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
11     public abstract Set getRequiredDescriptors();
12
13     public abstract void generate(CodeWriter writer, VarDescriptor dest);
14
15     public TypeDescriptor getType() {
16         assert td != null : toString();
17         return td;
18     }
19
20     public abstract TypeDescriptor typecheck(SemanticAnalyzer sa);
21
22     public abstract void prettyPrint(PrettyPrinter pp);
23
24     public Set getInversedRelations() {
25         throw new IRException("unsupported");
26     }
27
28     public DNFRule constructDNF() {
29         return new DNFRule(this);
30     }
31
32     public Descriptor getDescriptor() {
33         return null;
34     }
35
36     public int[] getRepairs(boolean negated) {
37         return new int[0];
38     }
39
40     public boolean inverted() {
41         return false;
42     }
43
44     public boolean usesDescriptor(RelationDescriptor rd) {
45         return false;
46     }
47
48 }