@Override
    public TypeInfo TypeCheck(CompilationContext cont) throws Exception {
        TypeInfo eval_leftTypeInfo = leftExpr.TypeCheck(cont);
        TypeInfo eval_rightTypeInfo = rightExpr.TypeCheck(cont);

        if (eval_leftTypeInfo != eval_rightTypeInfo) {
            throw new Exception("Wrong Type in expression");
        }

        if (eval_leftTypeInfo == TypeInfo.TYPE_STRING
                && (!(m_op == RelationalOperators.TOK_EQ
                || m_op == RelationalOperators.TOK_NEQ))) {
            throw new Exception("Only == and != supported for string type ");
        }

        if (eval_leftTypeInfo == TypeInfo.TYPE_BOOL
                && (!(m_op == RelationalOperators.TOK_EQ
                || m_op == RelationalOperators.TOK_NEQ))) {
            throw new Exception("Only == and != supported for boolean type ");
        }
        // store the operand type as well
        _opType = eval_leftTypeInfo;
        _type = TypeInfo.TYPE_BOOL;
        return _type;
    }