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 }); }
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 })); }
private void GenerateGlobal() { var gGen = new GlobalGen(Data); FileHelper.Write(OutputPath + "Global/Gen", "Global.Gen.cs", gGen.Generate()); }