本文整理汇总了C#中ProtoCore.Core类的典型用法代码示例。如果您正苦于以下问题:C# ProtoCore.Core类的具体用法?C# ProtoCore.Core怎么用?C# ProtoCore.Core使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtoCore.Core类属于命名空间,在下文中一共展示了ProtoCore.Core类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
core = new ProtoCore.Core(new ProtoCore.Options());
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
coreRunner = new ProtoScript.Runners.ProtoScriptTestRunner();
}
示例2: BuildStatus
// logs all errors and warnings by default
//
public BuildStatus(Core core,bool warningAsError, System.IO.TextWriter writer = null, bool errorAsWarning = false)
{
this.core = core;
//this.errorCount = 0;
//this.warningCount = 0;
warnings = new List<BuildData.WarningEntry>();
errors = new List<BuildData.ErrorEntry>();
this.warningAsError = warningAsError;
this.errorAsWarning = errorAsWarning;
if (writer != null)
{
consoleOut = System.Console.Out;
System.Console.SetOut(writer);
}
// Create a default console output stream, and this can
// be overwritten in IDE by assigning it a different value.
this.MessageHandler = new ConsoleOutputStream();
if (core.Options.WebRunner)
{
this.WebMsgHandler = new WebOutputStream(core);
}
}
示例3: DebugRunner
public DebugRunner(ProtoCore.Core core)
{
this.core = core;
this.core.Options.IDEDebugMode = true;
RegisteredBreakpoints = new List<Breakpoint>();
executionsuspended = false;
}
示例4: Setup
public void Setup()
{
ProtoCore.Options options = new ProtoCore.Options();
core = new ProtoCore.Core(options);
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
}
示例5: _PreStart
/// <summary>
/// Setup to run with customised launch options
/// </summary>
/// <returns>Ready to run?</returns>
///
private bool _PreStart(string code, string fileName)
{
this.code = code;
if (null == core)
{
core = new ProtoCore.Core(new ProtoCore.Options { IDEDebugMode = true });
core.Compilers.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Compiler(core));
core.Compilers.Add(ProtoCore.Language.kImperative, new ProtoImperative.Compiler(core));
}
if (null != fileName)
{
core.CurrentDSFileName = Path.GetFullPath(fileName);
core.Options.RootModulePathName = Path.GetFullPath(fileName);
}
//Run the compilation process
if (Compile(out resumeBlockID))
{
inited = true;
runtimeCore = CreateRuntimeCore(core);
FirstExec();
diList = BuildReverseIndex();
return true;
}
else
{
inited = false;
return false;
}
}
示例6: TestClassUsageInImpeartive
public void TestClassUsageInImpeartive()
{
ProtoCore.Core core = new ProtoCore.Core(new ProtoCore.Options());
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
ProtoScript.Runners.ProtoScriptTestRunner fsr = new ProtoScript.Runners.ProtoScriptTestRunner();
ExecutionMirror mirror = fsr.Execute(
@"
class foo
{
m : var;
constructor Create(a1 : int)
{
m = a1;
}
}
x;y;
[Imperative]
{
p = foo.Create(16);
x = p.m;
p.m = 32;
y = p.m;
}
"
, core, out compileState);
Assert.IsTrue((Int64)mirror.GetValue("x", 0).Payload == 16);
Assert.IsTrue((Int64)mirror.GetValue("y", 0).Payload == 32);
}
示例7: Setup
public void Setup()
{
core = new ProtoCore.Core(new ProtoCore.Options());
core.Options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
}
示例8: Setup
public void Setup()
{
Console.WriteLine("Setup");
core = new ProtoCore.Core(new ProtoCore.Options());
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
}
示例9: DebugRunner
public DebugRunner(ProtoCore.Core core)
{
this.core = core;
this.core.Options.IDEDebugMode = true;
RegisteredBreakpoints = new List<Breakpoint>();
core.ExecMode = ProtoCore.DSASM.InterpreterMode.kNormal;
executionsuspended = false;
}
示例10: ExpressionInterpreterRunner
public ExpressionInterpreterRunner(ProtoCore.Core core, ProtoLanguage.CompileStateTracker compileState)
{
Core = core;
core.ExecMode = ProtoCore.DSASM.InterpreterMode.kExpressionInterpreter;
this.compileState = compileState;
compileState.ExecMode = ProtoCore.DSASM.InterpreterMode.kExpressionInterpreter; ;
}
示例11: TestScriptFile
ProtoScript.Runners.ProtoScriptTestRunner fsr = new ProtoScript.Runners.ProtoScriptTestRunner();
ProtoLanguage.CompileStateTracker compileState = null;
fsr.Execute(scriptCode, core, out compileState);
}
public void TestScriptFile(string filename)
{
ProtoCore.Core core = new ProtoCore.Core(new ProtoCore.Options());
示例12: TestScript
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
//DLLFFIHandler.Env = ProtoFFI.CPPModuleHelper.GetEnv();
//DLLFFIHandler.Register(FFILanguage.CPlusPlus, new ProtoFFI.PInvokeModuleHelper());
}
public void TestScript(string scriptCode)
{
ProtoCore.Core core = new ProtoCore.Core(new ProtoCore.Options());
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
示例13: Setup
public virtual void Setup()
{
core = new ProtoCore.Core(new ProtoCore.Options());
core.Compilers.Add(ProtoCore.Language.Associative, new ProtoAssociative.Compiler(core));
core.Compilers.Add(ProtoCore.Language.Imperative, new ProtoImperative.Compiler(core));
// This is set when a test is executed
runtimeCore = null;
}
示例14: BasicInfrastructureTest
public void BasicInfrastructureTest()
{
ProtoCore.Core core = new ProtoCore.Core(new ProtoCore.Options());
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
ProtoScript.Runners.ProtoScriptTestRunner fsr = new ProtoScript.Runners.ProtoScriptTestRunner();
fsr.Execute(
@"
[Imperative]
示例15: ExecutionMirror
/// <summary>
/// Create a mirror for a given executive
/// </summary>
/// <param name="exec"></param>
public ExecutionMirror(ProtoCore.DSASM.Executive exec, ProtoCore.Core coreObj)
{
Debug.Assert(exec != null, "Can't mirror a null executive");
core = coreObj;
MirrorTarget = exec;
LoadPropertyFilters();
}