Пример #1
0
        public override object GetValue(ExecutionContext ctx)
        {
            string    functionName = function.GetValue(ctx).ToString();
            Functor   f            = ctx.GetFunction(functionName);
            ArrayList arguments    = new ArrayList();

            if (!emptyArgsList)
            {
                if (args.GetType() == typeof(Sequence <Expression>))
                {
                    Sequence <Expression> seq = (Sequence <Expression>)args;

                    foreach (Expression ex in (Sequence <Expression>)args)
                    {
                        arguments.Add(ex.GetValue(ctx));
                    }
                }
                else
                {
                    arguments.Add(((Expression)args).GetValue(ctx));
                }
            }
            return(f.Execute(arguments.ToArray(), ctx));
        }
Пример #2
0
 public FunctionCall(Expression function, GCToken args)
 {
     this.function = function;
     this.args = args;
     this.emptyArgsList = (args.GetType() == typeof(Optional<Sequence<Expression>>));
 }
Пример #3
0
 public FunctionCall(Expression function, GCToken args)
 {
     this.function      = function;
     this.args          = args;
     this.emptyArgsList = (args.GetType() == typeof(Optional <Sequence <Expression> >));
 }