5 public abstract class Expr {
7 TypeDescriptor td = null;
10 /* Remap this's variables using the remap mapping */
11 public abstract boolean equals(Map remap, Expr e);
13 public abstract Set getRequiredDescriptors();
15 public abstract void generate(CodeWriter writer, VarDescriptor dest);
17 public TypeDescriptor getType() {
18 assert td != null : toString();
22 public String name() {
23 System.out.println(this.getClass().getName());
27 public abstract TypeDescriptor typecheck(SemanticAnalyzer sa);
29 public abstract void prettyPrint(PrettyPrinter pp);
31 public Set getInversedRelations() {
32 throw new IRException("unsupported");
35 public DNFRule constructDNF() {
36 return new DNFRule(this);
39 public Descriptor getDescriptor() {
43 public boolean isValue(TypeDescriptor td) {
47 public int[] getRepairs(boolean negated, Termination t) {
48 System.out.println(this.getClass().getName());
49 throw new Error("Unrecognized EXPR");
52 public boolean inverted() {
56 public Set useDescriptor(Descriptor d) {
60 public boolean usesDescriptor(Descriptor rd) {
61 System.out.println(this.getClass().getName());
62 throw new Error("UNIMPLEMENTED");
64 public boolean isNull() {
67 public boolean isNonNull() {
70 public Set freeVars() {
74 public void findmatch(Descriptor d, Set s) {
77 public Set getfunctions() {
81 public SetDescriptor getSet() {
82 return null; /* unknown value */
85 public Expr stripCastExpr() {
87 while (ptr instanceof CastExpr)
88 ptr=((CastExpr)ptr).getExpr();
92 public boolean isSafe() {
96 public Expr getLower() {
100 public Expr getUpper() {
103 public boolean isInvariant(Set vars) {
106 public Set findInvariants(Set vars) {
107 return new HashSet();