5 public class ExprPredicate extends Predicate {
10 public static final int SIZE=1;
11 public static final int COMPARISON=2;
13 public TypeDescriptor typecheck(SemanticAnalyzer sa) {
14 TypeDescriptor t=expr.typecheck(sa);
18 public String name() {
22 public int getType() {
23 if (((OpExpr)expr).left instanceof SizeofExpr)
25 else if (((OpExpr)expr).left instanceof RelationExpr)
27 else throw new Error("Unidentifiable Type");
30 public Opcode getOp() {
31 return ((OpExpr)expr).opcode;
34 public int rightSize() {
36 return OpExpr.getInt(((OpExpr)expr).right);
39 public boolean isRightInt() {
40 return OpExpr.isInt(((OpExpr)expr).right);
43 public ExprPredicate(Expr expr) {
45 throw new NullPointerException();
50 public Set getInversedRelations() {
51 return expr.getInversedRelations();
54 public int[] getRepairs(boolean negated, Termination t) {
55 return expr.getRepairs(negated,t);
58 public Descriptor getDescriptor() {
59 return expr.getDescriptor();
62 public boolean inverted() {
63 return expr.inverted();
66 public boolean usesDescriptor(RelationDescriptor rd) {
67 return expr.usesDescriptor(rd);
70 public Set getRequiredDescriptors() {
71 return expr.getRequiredDescriptors();
74 public void generate(CodeWriter writer, VarDescriptor dest) {
75 expr.generate(writer, dest);