public void RegisterResolver(string symbolName, IFunctionResolver resolver) { symbols[symbolName] = resolver; }
public Expand(Value[] topArguments, Value[] bottomArguments, IFunctionResolver linker) { this.topArguments = topArguments; this.bottomArguments = bottomArguments; this.linker = linker; }
public UserFunctionStub(FunctionGraph graph, Value[] topArguments, Value[] bottomArguments, IFunctionResolver linker) { Name = graph.Name; int takeTop = ArgumentsToTake(graph.TopArguments); int takeBottom = ArgumentsToTake(graph.BottomArguments); makeNewFunction = () => { topEllipsis = topArguments.Any(x => x.Equals(ellipses)); bottomEllipsis = bottomArguments.Any(x => x.Equals(ellipses)); if (takeTop > 0) { if (!BufferArguments(takeTop, topArgumentBuffer, topArguments, TopInput)) { return(null); } } if (takeBottom > 0) { if (!BufferArguments(takeBottom, bottomArgumentBuffer, bottomArguments, BottomInput)) { return(null); } } return(new UserDefinedFunction(graph, topArguments, bottomArguments, linker)); }; }