public FunctionMeta GetFunctionMeta(out Expression[] DefaultValues)
        {
            ConsumeWS();
            if (Read(4).ToUpper() != "FUNC")
            {
                throw new Exception("WHAT'S THE FU.U.U..U.U ....");
            }
            ConsumeWS();
            var Ret = new FunctionMeta()
            {
                Name = Getstr(Reg_AlphaNum)
            };

            var ArgDef = ParseArgList();

            Ret.Parameters = ArgDef.Select(x => new ArgumentMeta()
            {
                Name = x.ArgName, ArgType = x.MyType
            });
            DefaultValues = ArgDef.Select(x => x.DefaultValue).ToArray();
            if (!TryParseCast(out Ret.ReturnType))
            {
                Ret.ReturnType = typeof(object);
            }
            return(Ret);
        }
        public override Expression CallFunc(FunctionMeta Name, IEnumerable<Expression> Parameters)
        {
            var Info = (AssemblyFunction)Name.Information;
            return Expression.Invoke(
                Expression.MakeMemberAccess(null, Info.DelegateField),
                Parameters);

        }
        public FunctionMeta GetFunctionMeta(out Expression[] DefaultValues)
        {
            ConsumeWS();
            if (Read(4).ToUpper() != "FUNC") throw new Exception("WHAT'S THE FU.U.U..U.U ....");
            ConsumeWS();
            var Ret = new FunctionMeta(){ Name = Getstr(Reg_AlphaNum) };

            var ArgDef = ParseArgList();
            Ret.Parameters = ArgDef.Select(x => new ArgumentMeta() { Name = x.ArgName, ArgType = x.MyType });
            DefaultValues = ArgDef.Select(x => x.DefaultValue).ToArray();
            if (!TryParseCast(out Ret.ReturnType)) Ret.ReturnType = typeof(object);
            return Ret;
        }
示例#4
0
        public override Expression CallFunc(FunctionMeta Name, IEnumerable<Expression> Parameters)
        {
            //Functions[Name]
            //var Info = (AssemblyFunction)Name.Information;
            return Expression.Invoke(
                Expression.MakeIndex(
                    Expression.MakeMemberAccess(
                        ThisAccess
                    , FunctionsField), 
                    FunctionsField.FieldType.GetRuntimeProperty("Item"), 
                    new Expression[] {Expression.Constant(Name.Name, typeof(string))}),
                Parameters);

        }
示例#5
0
 public override Expression CallFunc(FunctionMeta Name, IEnumerable <Expression> Parameters)
 {
     return(Expression.Call(null, Name.Information as MethodInfo, Parameters));
 }
示例#6
0
 public abstract Expression CallFunc(FunctionMeta Name, IEnumerable <Expression> Parameters);
 public override Expression CallFunc(FunctionMeta Name, IEnumerable<Expression> Parameters) { return this.Parent.CallFunc(Name, Parameters); }
示例#8
0
 public abstract Expression CallFunc(FunctionMeta Name, IEnumerable<Expression> Parameters);
 public override Expression CallFunc(FunctionMeta Name, IEnumerable <Expression> Parameters)
 {
     return(this.Parent.CallFunc(Name, Parameters));
 }
示例#10
0
 public override Expression CallFunc(FunctionMeta Name, IEnumerable<Expression> Parameters)
 {
     return Expression.Call(null, Name.Information as MethodInfo, Parameters);
 }