Checking in specs
[repair.git] / Repair / RepairCompiler / MCC / IR / LogicStatement.java
index ab23ec37006a7bfe5219f0e6be00fba8d5bb0774..f31c81555df7aa7ac9c1a683620e51c77967ed12 100755 (executable)
@@ -29,6 +29,19 @@ public class LogicStatement {
         return set;
     }
     
+    public TypeDescriptor typecheck(SemanticAnalyzer sa) {
+       TypeDescriptor lt=left.typecheck(sa);
+       if (lt!=ReservedTypeDescriptor.INT)
+           return null;
+       TypeDescriptor rt;
+       if (op!=NOT) {
+           rt=right.typecheck(sa);
+           if (rt!=ReservedTypeDescriptor.INT)
+               return null;
+       }
+       return ReservedTypeDescriptor.INT;
+    }
+
     public DNFConstraint constructDNF() {
        if (op==AND) {
            DNFConstraint leftd=left.constructDNF();