Esempio n. 1
0
        public static Expression<Func<Scope, object>> Generate(Block block, BinderFactory factory, string fileName)
        {
            Contract.Requires<ArgumentNullException>(block != null);
            Contract.Requires<ArgumentNullException>(factory != null);
            Contract.Requires<ArgumentNullException>(fileName != null);

            var global = Expression.Parameter(typeof(Scope), "global");
            var gen = new GlobalGen(fileName, factory, global);
            Expression expr = gen.Generate(block);
            if (expr.Type != typeof(object))
                expr = Expression.Convert(expr, typeof(object));
            return Expression.Lambda<Func<Scope, object>>(expr, "プログラム", new[] { global });
        }
Esempio n. 2
0
        public static Expression <Func <Scope, object> > Generate(Block block, BinderFactory factory, string fileName)
        {
            Contract.Requires <ArgumentNullException>(block != null);
            Contract.Requires <ArgumentNullException>(factory != null);
            Contract.Requires <ArgumentNullException>(fileName != null);

            var        global = Expression.Parameter(typeof(Scope), "global");
            var        gen    = new GlobalGen(fileName, factory, global);
            Expression expr   = gen.Generate(block);

            if (expr.Type != typeof(object))
            {
                expr = Expression.Convert(expr, typeof(object));
            }
            return(Expression.Lambda <Func <Scope, object> >(expr, "プログラム", new[] { global }));
        }
Esempio n. 3
0
        private void GenerateGlobal()
        {
            var gGen = new GlobalGen(Data);

            FileHelper.Write(OutputPath + "Global/Gen", "Global.Gen.cs", gGen.Generate());
        }