5 public class ExprPredicate extends Predicate {
8 public static final int SIZE=1;
9 public static final int COMPARISON=2;
11 public TypeDescriptor typecheck(SemanticAnalyzer sa) {
12 TypeDescriptor t=expr.typecheck(sa);
16 public String name() {
20 public int getType() {
21 if (((OpExpr)expr).left instanceof SizeofExpr)
23 else if (((OpExpr)expr).left instanceof RelationExpr)
25 else throw new Error("Unidentifiable Type");
28 public Opcode getOp() {
29 return ((OpExpr)expr).opcode;
32 public int rightSize() {
34 return OpExpr.getInt(((OpExpr)expr).right);
37 public boolean isRightInt() {
38 return OpExpr.isInt(((OpExpr)expr).right);
41 public ExprPredicate(Expr expr) {
43 throw new NullPointerException();
48 public Set getInversedRelations() {
49 return expr.getInversedRelations();
52 public int[] getRepairs(boolean negated, Termination t) {
53 return expr.getRepairs(negated,t);
56 public Descriptor getDescriptor() {
57 return expr.getDescriptor();
60 public boolean inverted() {
61 return expr.inverted();
64 public boolean usesDescriptor(RelationDescriptor rd) {
65 return expr.usesDescriptor(rd);
68 public Set getRequiredDescriptors() {
69 return expr.getRequiredDescriptors();
72 public void generate(CodeWriter writer, VarDescriptor dest) {
73 expr.generate(writer, dest);