Ejemplo n.º 1
0
 public static Signature comparisonExpressionSignature(
     ComparisonExpression.Type expressionType, Type leftType, Type rightType) {
   for (OperatorType operatorType : OperatorType.values()) {
     if (operatorType.name().equals(expressionType.name())) {
       return internalOperator(
           expressionType.name(),
           parseTypeSignature(StandardTypes.BOOLEAN),
           leftType.getTypeSignature(),
           rightType.getTypeSignature());
     }
   }
   return internalFunction(
       expressionType.name(),
       parseTypeSignature(StandardTypes.BOOLEAN),
       leftType.getTypeSignature(),
       rightType.getTypeSignature());
 }
Ejemplo n.º 2
0
 @Override
 protected Type visitArithmeticBinary(ArithmeticBinaryExpression node, AnalysisContext context) {
   return getOperator(
       context,
       node,
       OperatorType.valueOf(node.getType().name()),
       node.getLeft(),
       node.getRight());
 }
Ejemplo n.º 3
0
 @Override
 protected Type visitComparisonExpression(ComparisonExpression node, AnalysisContext context) {
   OperatorType operatorType;
   if (node.getType() == ComparisonExpression.Type.IS_DISTINCT_FROM) {
     operatorType = OperatorType.EQUAL;
   } else {
     operatorType = OperatorType.valueOf(node.getType().name());
   }
   return getOperator(context, node, operatorType, node.getLeft(), node.getRight());
 }