Examples of ConditionalExpression


Examples of org.eclipse.jdt.internal.compiler.ast.ConditionalExpression

        if (innerCtx != null) { // otherwise innerMethod does not participate in inference
          return addConstraintsToC(invocation.arguments(), c, innerMethod.genericMethod(), innerCtx.inferenceKind);
        }
      }
    } else if (expri instanceof ConditionalExpression) {
      ConditionalExpression ce = (ConditionalExpression) expri;
      return addConstraintsToC_OneExpr(ce.valueIfTrue, c, fsi, substF, method)
         && addConstraintsToC_OneExpr(ce.valueIfFalse, c, fsi, substF, method);
    }
    return true;
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.ConditionalExpression

        if (r2.isPrimitiveType() && !r1.isPrimitiveType() && !returnType.isPrimitiveType())
          return true;
      }
      return reduceAndIncorporate(ConstraintTypeFormula.create(r1, r2, ReductionResult.SUBTYPE));
    } else if (expri instanceof ConditionalExpression) {
      ConditionalExpression cond = (ConditionalExpression) expri;
      return  checkExpression(cond.valueIfTrue, u, r1, v, r2) && checkExpression(cond.valueIfFalse, u, r1, v, r2);
    } else {
      return false;
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.ConditionalExpression

          return null; // already incorporated
        } finally {
          inferenceContext.resumeSuspendedInference(prevInvocation);
        }
      } else if (this.left instanceof ConditionalExpression) {
        ConditionalExpression conditional = (ConditionalExpression) this.left;
        return new ConstraintFormula[] {
          new ConstraintExpressionFormula(conditional.valueIfTrue, this.right, this.relation, this.isSoft),
          new ConstraintExpressionFormula(conditional.valueIfFalse, this.right, this.relation, this.isSoft)
        };
      } else if (this.left instanceof LambdaExpression) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.ConditionalExpression

          sam.parameters[i].collectInferenceVariables(variables);
        }
        return variables;
      }     
    } else if (this.left instanceof ConditionalExpression && this.left.isPolyExpression()) {
      ConditionalExpression expr = (ConditionalExpression) this.left;
      Set<InferenceVariable> variables = new HashSet<InferenceVariable>();
      variables.addAll(new ConstraintExpressionFormula(expr.valueIfTrue, this.right, COMPATIBLE).inputVariables(context));
      variables.addAll(new ConstraintExpressionFormula(expr.valueIfFalse, this.right, COMPATIBLE).inputVariables(context));
      return variables;
    }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.ConditionalExpression

  //optimize the push/pop
  this.intPtr -= 2;//consume position of the question mark
  this.expressionPtr -= 2;
  this.expressionLengthPtr -= 2;
  this.expressionStack[this.expressionPtr] =
    new ConditionalExpression(
      this.expressionStack[this.expressionPtr],
      this.expressionStack[this.expressionPtr + 1],
      this.expressionStack[this.expressionPtr + 2]);
}
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.ConditionalExpression

  this.intPtr -= 2;//consume position of the question mark
  pushOnExpressionStack(getUnspecifiedReferenceOptimized());
  this.expressionPtr -= 2;
  this.expressionLengthPtr -= 2;
  this.expressionStack[this.expressionPtr] =
    new ConditionalExpression(
      this.expressionStack[this.expressionPtr + 2],
      this.expressionStack[this.expressionPtr],
      this.expressionStack[this.expressionPtr + 1]);
}
View Full Code Here

Examples of org.eclipse.php.internal.core.compiler.ast.nodes.ConditionalExpression

    return null;
  }

  public IGoal[] init() {
    ExpressionTypeGoal typedGoal = (ExpressionTypeGoal) goal;
    ConditionalExpression conditionalExpression = (ConditionalExpression) typedGoal
        .getExpression();
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=339405
    List<IGoal> result = new ArrayList<IGoal>();
    if (conditionalExpression.getIfTrue() != null) {
      result.add(new ExpressionTypeGoal(goal.getContext(),
          conditionalExpression.getIfTrue()));
    }
    if (conditionalExpression.getIfFalse() != null) {
      result.add(new ExpressionTypeGoal(goal.getContext(),
          conditionalExpression.getIfFalse()));
    }
    return result.toArray(new IGoal[result.size()]);
  }
View Full Code Here

Examples of org.lilystudio.javascript.expression.ConditionalExpression

    case Token.SETELEM_OP:
    case Token.COMMA:
      return new BinaryExpression(node, root, scope);

    case Token.HOOK:
      return new ConditionalExpression(node, root, scope);

    case Token.FUNCTION:
      return new FunctionLiteral(node, root, scope);

    default:
View Full Code Here

Examples of org.mozilla.javascript.ast.ConditionalExpression

    return node.toSource();
  }

  @Override
  public AstNode conditionalExpression(AstNode test, AstNode trueExpr, AstNode falseExpr) {
    ConditionalExpression c = new ConditionalExpression();
    c.setTestExpression(test);
    c.setTrueExpression(trueExpr);
    c.setFalseExpression(falseExpr);
    return c;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.