internal void Accept(ExpressionObject obj) { if (Lhs == null) { Lhs = obj; } else if (Operator == null) { Operator = obj; } else { Rhs = obj; } }
private static (object left, object right) ProcessOperands(ExecutionContext ctx, ExpressionObject lhs, ExpressionObject rhs) { object lhsVal = lhs.Value(ctx); Type target = lhs.IsNull(ctx) ? typeof(string) : (BooleanExpressionObject.CouldParse(lhsVal) ? typeof(bool) : (NumberExpressionObject.CouldParse(lhsVal) ? typeof(decimal) : typeof(string))); return(left : ChangeType(lhsVal, target), right : ChangeType(rhs.Value(ctx), target)); }
internal ExpressionObject Evaluate(ExecutionContext ctx, ExpressionObject lhs, ExpressionObject rhs) { return(Handlers[Source](ctx, lhs, rhs)); }