示例#1
0
 public ConcreteFunctionWithConvertation(
     IConcreteFunction origin,
     FunTypeSpecification resultType,
     Func <object, object>[] inputConverters,
     Func <object, object> outputConverter)
 {
     _origin          = origin;
     _resultType      = resultType;
     _inputConverters = inputConverters;
     _outputConverter = outputConverter;
 }
示例#2
0
        private IExpressionNode CreateFunctionCall(IFunCallSyntaxNode node, IConcreteFunction function)
        {
            var children  = node.Args.SelectToArray(ReadNode);
            var converted = function.CreateWithConvertionOrThrow(children, node.Interval);

            if (converted.Type != node.OutputType)
            {
                var converter = VarTypeConverter.GetConverterOrThrow(converted.Type, node.OutputType, node.Interval);
                return(new CastExpressionNode(converted, node.OutputType, converter, node.Interval));
            }
            else
            {
                return(converted);
            }
        }
示例#3
0
 public FunVariableExpressionNode(IConcreteFunction fun, Interval interval)
 {
     _value   = fun;
     Interval = interval;
     Type     = FunnyType.Fun(_value.ReturnType, _value.ArgTypes);
 }