public BoundAggregatedValue(ValueSlot output, AggregateSymbol aggregate, IAggregatable aggregatable, BoundExpression argument) { Output = output; Aggregate = aggregate; Aggregatable = aggregatable; Argument = argument; }
public static bool IsRejectingNull(BoundExpression expression, ValueSlot valueSlot) { // Only for node types listed below we can predict if the expression will yield // null/false. For all other node types this is unknown. switch (expression.Kind) { case BoundNodeKind.IsNullExpression: return(IsRejectingNull((BoundIsNullExpression)expression, valueSlot)); case BoundNodeKind.UnaryExpression: return(IsRejectingNull((BoundUnaryExpression)expression, valueSlot)); case BoundNodeKind.BinaryExpression: return(IsRejectingNull((BoundBinaryExpression)expression, valueSlot)); case BoundNodeKind.ColumnExpression: return(IsRejectingNull((BoundColumnExpression)expression, valueSlot)); case BoundNodeKind.ValueSlotExpression: return(IsRejectingNull((BoundValueSlotExpression)expression, valueSlot)); case BoundNodeKind.PropertyAccessExpression: return(IsRejectingNull((BoundPropertyAccessExpression)expression, valueSlot)); case BoundNodeKind.MethodInvocationExpression: return(IsRejectingNull((BoundMethodInvocationExpression)expression, valueSlot)); default: return(false); } }
private void BindToCommonType(TextSpan diagnosticSpan, ValueSlot left, ValueSlot right, out BoundExpression newLeft, out BoundExpression newRight) { newLeft = null; newRight = null; if (left.Type == right.Type || left.Type.IsError() || right.Type.IsError()) { return; } var conversionLeftToRight = Conversion.Classify(left.Type, right.Type); var conversionRightToLeft = Conversion.Classify(right.Type, left.Type); if (conversionLeftToRight.IsImplicit && conversionRightToLeft.IsImplicit) { // TODO: We may want to report an ambiguity error here. } if (conversionLeftToRight.IsImplicit) { newLeft = BindConversion(diagnosticSpan, new BoundValueSlotExpression(left), right.Type); } else { newRight = BindConversion(diagnosticSpan, new BoundValueSlotExpression(right), left.Type); } }
public BoundValueSlotExpression Update(ValueSlot valueSlot) { if (valueSlot == ValueSlot) { return(this); } return(new BoundValueSlotExpression(valueSlot)); }
public BoundComparedValue Update(ValueSlot valueSlot, IComparer comparer) { if (valueSlot == ValueSlot && comparer == Comparer) { return(this); } return(new BoundComparedValue(valueSlot, comparer)); }
public BoundJoinRelation(BoundJoinType joinType, BoundRelation left, BoundRelation right, BoundExpression condition, ValueSlot probe, BoundExpression passthruPredicate) { Left = left; Right = right; JoinType = joinType; Condition = condition; Probe = probe; PassthruPredicate = passthruPredicate; }
private static bool IsRejectingNull(BoundUnaryExpression expression, ValueSlot valueSlot) { if (expression.OperatorKind == UnaryOperatorKind.LogicalNot) { return(!IsRejectingNull(expression.Expression, valueSlot)); } return(IsRejectingNull(expression.Expression, valueSlot)); }
public BoundAggregatedValue Update(ValueSlot output, AggregateSymbol aggregate, IAggregatable aggregatable, BoundExpression argument) { if (output == Output && aggregate == Aggregate && aggregatable == Aggregatable && argument == Argument) { return(this); } return(new BoundAggregatedValue(output, aggregate, aggregatable, argument)); }
public BoundSingleRowSubselect Update(ValueSlot value, BoundRelation relation) { if (value == Value && relation == Relation) { return(this); } return(new BoundSingleRowSubselect(value, relation)); }
public BoundComputedValue Update(BoundExpression expression, ValueSlot valueSlot) { if (expression == Expression && valueSlot == ValueSlot) { return(this); } return(new BoundComputedValue(expression, valueSlot)); }
public BoundHashMatchRelation(BoundHashMatchOperator logicalOperator, BoundRelation build, BoundRelation probe, ValueSlot buildKey, ValueSlot probeKey, BoundExpression remainder) { LogicalOperator = logicalOperator; Build = build; Probe = probe; BuildKey = buildKey; ProbeKey = probeKey; Remainder = remainder; }
public BoundUnifiedValue Update(ValueSlot valueSlot, IEnumerable <ValueSlot> inputValueSlots) { var newInputValueSlots = inputValueSlots.ToImmutableArray(); if (valueSlot == ValueSlot && newInputValueSlots == InputValueSlots) { return(this); } return(new BoundUnifiedValue(valueSlot, newInputValueSlots)); }
private static bool IsRejectingNull(BoundBinaryExpression expression, ValueSlot valueSlot) { if (expression.OperatorKind == BinaryOperatorKind.LogicalOr) { // Special handling for logical OR: // For logical OR both arguments must be NULL to yield FALSE/NULL. return(IsRejectingNull(expression.Left, valueSlot) && IsRejectingNull(expression.Right, valueSlot)); } // In all other cases we know the result will be FALSE/NULL if // any operand is NULL. return(IsRejectingNull(expression.Left, valueSlot) || IsRejectingNull(expression.Right, valueSlot)); }
public BoundComputedValue(BoundExpression expression, ValueSlot valueSlot) { Expression = expression; ValueSlot = valueSlot; }
protected virtual ValueSlot RewriteValueSlot(ValueSlot valueSlot) { return(valueSlot); }
public BoundSingleRowSubselect(ValueSlot value, BoundRelation relation) { Value = value; Relation = relation; }
private static bool IsRejectingNull(BoundIsNullExpression expression, ValueSlot valueSlot) { return(!IsRejectingNull(expression.Expression, valueSlot)); }
public BoundOrderBySelector(ValueSlot valueSlot, BoundComputedValueWithSyntax?computedValue) { ValueSlot = valueSlot; ComputedValue = computedValue; }
public BoundJoinRelation Update(BoundJoinType joinType, BoundRelation left, BoundRelation right, BoundExpression condition, ValueSlot probe, BoundExpression passthruPredicate) { if (joinType == JoinType && left == Left && right == Right && condition == Condition && probe == Probe && passthruPredicate == PassthruPredicate) { return(this); } return(new BoundJoinRelation(joinType, left, right, condition, probe, passthruPredicate)); }
public BoundComparedValue(ValueSlot valueSlot, IComparer comparer) { ValueSlot = valueSlot; Comparer = comparer; }
public BoundComputedValueWithSyntax(ExpressionSyntax syntax, BoundExpression expression, ValueSlot result) { Syntax = syntax; Expression = expression; Result = result; }
public BoundValueSlotExpression(ValueSlot valueSlot) { ValueSlot = valueSlot; }
private static bool IsRejectingNull(BoundColumnExpression expression, ValueSlot valueSlot) { return(expression.Symbol.ValueSlot == valueSlot); }
private static bool IsRejectingNull(BoundValueSlotExpression expression, ValueSlot valueSlot) { return(expression.ValueSlot == valueSlot); }
private static bool IsRejectingNull(BoundPropertyAccessExpression expression, ValueSlot valueSlot) { return(IsRejectingNull(expression.Target, valueSlot)); }
public BoundUnifiedValue(ValueSlot valueSlot, IEnumerable <ValueSlot> inputValueSlots) { ValueSlot = valueSlot; InputValueSlots = inputValueSlots.ToImmutableArray(); }
public BoundHashMatchRelation Update(BoundHashMatchOperator logicalOperator, BoundRelation build, BoundRelation probe, ValueSlot buildKey, ValueSlot probeKey, BoundExpression remainder) { if (logicalOperator == LogicalOperator && build == Build && probe == Probe && buildKey == BuildKey && probeKey == ProbeKey && remainder == Remainder) { return(this); } return(new BoundHashMatchRelation(logicalOperator, build, probe, buildKey, probeKey, remainder)); }
private static bool IsRejectingNull(BoundMethodInvocationExpression expression, ValueSlot valueSlot) { // NOTE: Arguments being NULL doesn't necessarily mean that the result will be NULL. return(IsRejectingNull(expression.Target, valueSlot)); }