Exemple #1
0
 public void RegisterResolver(string symbolName, IFunctionResolver resolver)
 {
     symbols[symbolName] = resolver;
 }
Exemple #2
0
 public Expand(Value[] topArguments, Value[] bottomArguments, IFunctionResolver linker)
 {
     this.topArguments    = topArguments;
     this.bottomArguments = bottomArguments;
     this.linker          = linker;
 }
Exemple #3
0
        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));
            };
        }