本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}