public override StringBuilder VisitFunctionCall(FunctionCallExpression expression, SymbolTable scope) { append("func {0}".FormatWith(expression.FunctionName)); appendType(expression); incr(); expression.Focus.Accept(this, scope); foreach (var arg in expression.Arguments) { arg.Accept(this, scope); } decr(); return(_result); }
public override Invokee VisitFunctionCall(FP.FunctionCallExpression expression, SymbolTable scope) { var focus = expression.Focus.ToEvaluator(scope); var arguments = new List <Invokee>() { focus }; arguments.AddRange(expression.Arguments.Select(arg => arg.ToEvaluator(scope))); // We have no real type information, so just pass object as the type var types = new List <Type>() { typeof(object) }; // for the focus; types.AddRange(expression.Arguments.Select(a => typeof(object))); // for the arguments // Now locate the function based on the types and name Invokee boundFunction = resolve(scope, expression.FunctionName, types); return(InvokeeFactory.Invoke(expression.FunctionName, arguments, boundFunction)); }
public abstract T VisitFunctionCall(FunctionCallExpression expression, SymbolTable scope);