public void Replace(String Name, FunctionDef Definition) { Func <IVariableProvider <T>, Delegate> d = vc => ExpressionEvaluator <T> .Compile(new VariableProviderCombiner <T>(vc, new ExpressionRuntimeProvider <T>()), Definition.Body); Replace(Name, Definition.Parameters, Definition.ReturnValue, d); }
public static Func <T, TReturn> Compile <TReturn>(IVariableProvider <T> VariableProvider, Expr Expr) { var ee = new ExpressionEvaluator <T>(VariableProvider, Expr, new Dictionary <Object, Firefly.Texting.TreeFormat.Syntax.TextRange>(), new Dictionary <Expr, PrimitiveType>()); return(ee.Compile <TReturn>()); }
public static Func <T, TReturn> Compile <TReturn>(IVariableProvider <T> VariableProvider, ExpressionParserExprResult Expr) { var ee = new ExpressionEvaluator <T>(VariableProvider, Expr.Body, Expr.Positions, Expr.TypeDict); return(ee.Compile <TReturn>()); }
public static Delegate Compile(IVariableProvider <T> VariableProvider, ExpressionParserExprResult Expr) { var ee = new ExpressionEvaluator <T>(VariableProvider, Expr.Body, Expr.Positions, Expr.TypeDict); return(ee.Compile()); }