示例#1
0
        public static void InitFusion( )
        {
            MainVM = new ManagedHost( );

            ScriptSource   init_ide_src      = new ScriptSource("data/script/ide/ide_init.vs");
            Compiler       comp              = new Compiler();
            CompiledSource init_ide_compiled = comp.Compile(init_ide_src);

            MainVM.SetEntry(init_ide_compiled.EntryPoint);

            void InitIDE(int w, int h, int fs)
            {
                App       = new FusionIDE(w, h, fs == 1);
                InitState = new States.CodeScreen();

                App.Run();
            }

            CFuncLink initIDE = new CFuncLink
            {
                Link = (t) =>
                {
                    InitIDE(t[0], t[1], t[2]);
                    return(null);
                }
            };

            MainVM.AddCFunc("InitIDE", initIDE);
            CodeScope scope = MainVM.RunEntry( );
        }
示例#2
0
        public bool Compile()
        {
            //Console.WriteLine("Mod:" + Path);
            // Console.WriteLine("Name:" + Name);


            Source = new ScriptSource(Path + "/" + Name + ".syn");

            Console.WriteLine("Compiling:" + Name + ".Module");
            CompiledSrc = SynHost.Comp.Compile(Source);
            Console.WriteLine("Compiled succesfully.");

            foreach (var mod in CompiledSrc.EntryPoint.Modules)
            {
                SubModules.Add(new SynModule(mod));
            }

            return(true);
            //var src = new SynScript.ScriptSource(Path)
        }
示例#3
0
        private static void Main(string [] args)
        {
            ScriptSource   src  = new ScriptSource("test1.vs");
            Compiler       comp = new Compiler();
            CompiledSource s    = comp.Compile(src);



            ManagedHost test_vme = new ManagedHost();

            test_vme.AddModule(new Module(s.EntryPoint));



            System.Console.WriteLine("R:" + test_vme.ExecuteStaticFunc("test"));



            while (true)
            {
            }
        }
示例#4
0
        static void Main(string[] args)
        {
            ScriptSource   src  = new ScriptSource("Foom/main.fs");
            Compiler       comp = new Compiler();
            CompiledSource s    = comp.Compile(src);



            ManagedHost test_vme = new ManagedHost();

            test_vme.AddModule(new Module(s.EntryPoint));

            InvaderAPP Foom = null;

            dynamic F_InitFoom(dynamic[] pars)
            {
                Console.WriteLine("Foom booting up.");

                Foom = new InvaderAPP();

                return(null);
            }

            var InitFoom = new CFuncLink
            {
                Link = F_InitFoom,
                Name = "InitFoom"
            };

            test_vme.RegFunc("InitFoom", InitFoom);


            System.Console.WriteLine("R:" + test_vme.ExecuteStaticFunc("Entry"));

            while (true)
            {
            }
        }