//TODO pass anything.may be Object needed?
public boolean validateBinaryExpr(BinaryExpr node) {
        ExprNode expr1 = node.getExpr1();
        ExprNode expr2 = node.getExpr2();
        Type t1 = expr1.getType();
        Type t2 = expr2.getType();
        String op = node.getOperation();
        switch (op) {
            case "==":
            case "!=":
                if (Types.isNumber(t1)) {
                    return this.requireNumber(expr2,t2);
                } else {
                    return true;
                    //TODO pass anything.may be Object needed?
                }
            case "+":
            case "-":
            case "*":
            case "/":
            case "%":
            case ">=":
            case "<=":
            case ">":
            case "<":
            case "&":
            case "|":
            case "^":
            case BinaryExpr.OP_SHIFT_LEFT:
            case BinaryExpr.OP_SHIFT_RIGHT:
            case BinaryExpr.OP_UNSIGNED_SHIFT_RIGHT:
                return this.requireNumber(expr1, t1) && this.requireNumber(expr2, t2);
            case "&&":
            case "||":
                return requireBoolean(expr1, t1) && requireBoolean(expr2, t2);
            default:
                diagnosisReporter.report(Diagnosis.Kind.ERROR, "unsupported operation:" + op, node.offset);
                return false;
        }
    }
} else {
return true;
//TODO pass anything.may be Object needed?
}
case "+":
Type t1 = expr1.getType();
Type t2 = expr2.getType();
String op = node.getOperation();
switch (op) {
case "==":
case "!=":
if (Types.isNumber(t1)) {
return this.requireNumber(expr2,t2);
} else {
return true;
//TODO pass anything.may be Object needed?
}
case "+":
case "-":
case "*":
case "/":
case "%":
case ">=":
case "<=":
case ">":
case "<":
public boolean validateBinaryExpr(BinaryExpr node) {
ExprNode expr1 = node.getExpr1();
ExprNode expr2 = node.getExpr2();
Type t1 = expr1.getType();
Type t2 = expr2.getType();
String op = node.getOperation();
switch (op) {
case "==":
case "!=":
if (Types.isNumber(t1)) {
return this.requireNumber(expr2,t2);
} else {
return true;
//TODO pass anything.may be Object needed?
}
case "+":
case "-":
case "*":
case "/":
case "%":
case ">=":
case "<=":
case ">":
case "<":
case "&":
case "|":
case "^":
case BinaryExpr.OP_SHIFT_LEFT:
case BinaryExpr.OP_SHIFT_RIGHT:
case BinaryExpr.OP_UNSIGNED_SHIFT_RIGHT:
return this.requireNumber(expr1, t1) && this.requireNumber(expr2, t2);
case "&&":
case "||":
return requireBoolean(expr1, t1) && requireBoolean(expr2, t2);