1e13217e4d85904234140fa3d71c29ea13d24307
[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 boolean isValue() {
44         return false;
45     }
46
47     public int[] getRepairs(boolean negated) {
48         System.out.println(this.getClass().getName());
49         throw new Error("Unrecognized EXPR");
50     }
51
52     public boolean inverted() {
53         return false;
54     }
55
56     public boolean usesDescriptor(Descriptor rd) {
57         System.out.println(this.getClass().getName());
58         throw new Error("UNIMPLEMENTED");
59     }
60     public boolean isNull() {
61         return false;
62     }
63     public boolean isNonNull() {
64         return false;
65     }
66     public Set freeVars() {
67         return null;
68     }
69
70     public void findmatch(Descriptor d, Set s) {
71     }
72 }