当前位置: 首页>>代码示例>>C#>>正文


C# ProtoCore.GenerateExecutable方法代码示例

本文整理汇总了C#中ProtoCore.GenerateExecutable方法的典型用法代码示例。如果您正苦于以下问题:C# ProtoCore.GenerateExecutable方法的具体用法?C# ProtoCore.GenerateExecutable怎么用?C# ProtoCore.GenerateExecutable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProtoCore的用法示例。


在下文中一共展示了ProtoCore.GenerateExecutable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        private ExecutionMirror Execute(string code, ProtoCore.Core core, bool isTest = true)
        {
            int blockId = ProtoCore.DSASM.Constants.kInvalidIndex;
            bool succeeded = Compile(code, core, out blockId);

            if (succeeded)
            {
                core.GenerateExecutable();
                core.Rmem.PushFrameForGlobals(core.GlobOffset);
                core.RunningBlock = blockId;
                Execute(core);

                if (!isTest) { core.Heap.Free(); }


                if (isTest && !core.Options.CompileToLib)
                    return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
                else
                    return null;
            }
            //else
            //  throw new ProtoCore.Exceptions.CompileErrorsOccured();

            //if (isTest && !core.Options.CompileToLib)
            //    return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
            //else
            return null;
        }
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:28,代码来源:ProtoScriptWebRunner.cs

示例2: Execute

 public void Execute(string code, ProtoCore.Core core)
 {
     int blockId = ProtoCore.DSASM.Constants.kInvalidIndex;
     bool succeeded = Compile(code, core, out blockId);
     if (succeeded)
     {
         core.GenerateExecutable();
         core.Rmem.PushFrame(core.GlobOffset);
         core.RunningBlock = blockId;
         Execute(core);
         core.Heap.Free();
     }
     else
         throw new ProtoCore.Exceptions.CompileErrorsOccured();
 }
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:15,代码来源:ProtoScriptRunner.cs

示例3: CompileAndGenerateExe

 /// <summary>
 /// The public method to compile DS AST and stores the executable in core
 /// </summary>
 /// <param name="astList"></param>
 /// <param name="compileCore"></param>
 /// <returns></returns>
 public bool CompileAndGenerateExe(
     List<ProtoCore.AST.AssociativeAST.AssociativeNode> astList, 
     ProtoCore.Core compileCore,
     ProtoCore.CompileTime.Context context)
 {
     bool succeeded = Compile(astList, compileCore, context);
     if (succeeded)
     {
         compileCore.GenerateExecutable();
     }
     return succeeded;
 }
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:18,代码来源:ProtoScriptRunner.cs

示例4: Execute

        public ExecutionMirror Execute(string code, ProtoCore.Core core, bool isTest = true)
        {
            int blockId = ProtoCore.DSASM.Constants.kInvalidIndex;
            bool succeeded = Compile(code, core, out blockId);
            if (succeeded)
            {
                core.GenerateExecutable();
                core.Rmem.PushGlobFrame(core.GlobOffset);
                core.RunningBlock = blockId;

                try
                {
                    Execute(core, new ProtoCore.Runtime.Context());
                }
                catch (ProtoCore.Exceptions.ExecutionCancelledException e)
                {
                    Console.WriteLine("The execution has been cancelled!");             
                }
                
                if (!isTest)
                {
                    core.Heap.Free();
                }
            }
            else
            {
                throw new ProtoCore.Exceptions.CompileErrorsOccured();
            }

            if (isTest && !core.Options.CompileToLib)
            {
                return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
            }

            return null;
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:36,代码来源:ProtoScriptTestRunner.cs

示例5: CompileMe

        /// <summary>
        /// The public method to compile DS code
        /// </summary>
        /// <param name="sourcecode"></param>
        /// <param name="compileCore"></param>
        /// <param name="dsExecutable"></param>
        /// <returns></returns>
        public bool CompileMe(string sourcecode, ProtoCore.Core compileCore, out Executable dsExecutable)
        {
            int blockID = 0;
            bool succeeded = Compile(sourcecode, compileCore, out blockID);

            compileCore.GenerateExecutable();
            dsExecutable = compileCore.DSExecutable;

            return succeeded;
        }
开发者ID:rafatahmed,项目名称:Dynamo,代码行数:17,代码来源:ProtoScriptTestRunner.cs

示例6: Execute

        /// <summary>
        /// Compile and execute the given sourcecode
        /// </summary>
        /// <param name="code"></param>
        /// <param name="core"></param>
        /// <param name="isTest"></param>
        /// <returns></returns>
        public ExecutionMirror Execute(string sourcecode, ProtoCore.Core core, out ProtoCore.RuntimeCore runtimeCoreOut, bool isTest = true)
        {
            ProtoCore.RuntimeCore runtimeCore = null;
            int blockId = ProtoCore.DSASM.Constants.kInvalidIndex;
            bool succeeded = Compile(sourcecode, core, out blockId);
            if (succeeded)
            {
                core.GenerateExecutable();
                try
                {
                    runtimeCore = Execute(core, blockId, new ProtoCore.CompileTime.Context());
                }
                catch (ProtoCore.Exceptions.ExecutionCancelledException e)
                {
                    Console.WriteLine("The execution has been cancelled!");             
                }
                
                if (!isTest)
                {
                    runtimeCore.RuntimeMemory.Heap.Free();
                }
            }
            else
            {
                throw new ProtoCore.Exceptions.CompileErrorsOccured();
            }

            runtimeCoreOut = runtimeCore;

            if (isTest && !core.Options.CompileToLib)
            {
                return new ExecutionMirror(runtimeCore.CurrentExecutive.CurrentDSASMExec, runtimeCore);
            }

            return null;
        }
开发者ID:rafatahmed,项目名称:Dynamo,代码行数:43,代码来源:ProtoScriptTestRunner.cs

示例7: Execute

        public ExecutionMirror Execute(string code, ProtoCore.Core core, bool isTest = true)
        {
            int blockId = ProtoCore.DSASM.Constants.kInvalidIndex;
            bool succeeded = Compile(code, core, out blockId);
            if (succeeded)
            {
                core.GenerateExecutable();
                core.Rmem.PushGlobFrame(core.GlobOffset);
                core.RunningBlock = blockId;

                Execute(core, new ProtoCore.Runtime.Context());
                if (!isTest)
                {
                    core.Heap.Free();
                }
            }
            else
            {
                throw new ProtoCore.Exceptions.CompileErrorsOccured();
            }

            if (isTest && !core.Options.CompileToLib)
            {
                return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
            }

            // Save the Callsite state for this execution
            if (core.EnableCallsiteExecutionState)
            {
                ProtoCore.CallsiteExecutionState.SaveState(core.csExecutionState);
            }

            return null;
        }
开发者ID:algobasket,项目名称:Dynamo,代码行数:34,代码来源:ProtoScriptTestRunner.cs


注:本文中的ProtoCore.GenerateExecutable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。