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


C# ProtoScript.Runners.ProtoScriptRunner.Execute方法代码示例

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


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

示例1: RedefineWithFunctions03

        public void RedefineWithFunctions03()
        {
            String code =
@"
class C
{
    mx : var;
    constructor C()
    {
        mx = 10;
    }
    def f(a : int)
    {
        mx = a + 1;
        return = mx;
    }
}
x = 10;
p = C.C();
x = p.f(x);
";
            ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
            runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
            Assert.IsTrue((Int64)mirror.GetValue("x").Payload == 11);
        }
开发者ID:norbertzsiros,项目名称:Dynamo,代码行数:25,代码来源:RedefinitionExpression.cs

示例2:

            ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
            fsr.Execute(
@"
[Associative]
{
    a = [Imperative]
        {
开发者ID:lewshion,项目名称:Dynamo,代码行数:7,代码来源:MultiLanugageBasic.cs

示例3: GetUpcastChainTest

        public void GetUpcastChainTest()
        {
            String code =
@"class A {}
class B extends A {}
class C extends B {}
";
            ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
            ProtoCore.RuntimeCore runtimeCore = null;
            runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
            int idA = core.ClassTable.IndexOf("A");
            int idB = core.ClassTable.IndexOf("B");
            int idC = core.ClassTable.IndexOf("C");
            ClassNode cnA = core.ClassTable.ClassNodes[idA];
            ClassNode cnB = core.ClassTable.ClassNodes[idB];
            ClassNode cnC = core.ClassTable.ClassNodes[idC];
            List<int> idsA = ClassUtils.GetClassUpcastChain(cnA, runtimeCore);
            List<int> idsB = ClassUtils.GetClassUpcastChain(cnB, runtimeCore);
            List<int> idsC = ClassUtils.GetClassUpcastChain(cnC, runtimeCore);
            Assert.IsTrue(idsA.Count == 2);
            Assert.IsTrue(idsA.Contains(idA));

            Assert.IsTrue(idsB.Count == 3);
            Assert.IsTrue(idsB.Contains(idA));
            Assert.IsTrue(idsB.Contains(idB));
            Assert.IsTrue(idsC.Count == 4);
            Assert.IsTrue(idsC.Contains(idA));
            Assert.IsTrue(idsC.Contains(idB));
            Assert.IsTrue(idsC.Contains(idC));
        }
开发者ID:Conceptual-Design,项目名称:Dynamo,代码行数:30,代码来源:ClassUtilsTest.cs

示例4: ExecuteAndVerify

 protected int ExecuteAndVerify(String code, ValidationData[] data, Dictionary<string, Object> context, out int nErrors)
 {
     ProtoCore.Core core = Setup();
     ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
     ProtoCore.CompileTime.Context compileContext = new ProtoCore.CompileTime.Context(code, context);
     ProtoCore.RuntimeCore runtimeCore = null;
     ExecutionMirror mirror = fsr.Execute(compileContext, core, out runtimeCore);
     int nWarnings = runtimeCore.RuntimeStatus.WarningCount;
     nErrors = core.BuildStatus.ErrorCount;
     if (data == null)
     {
         runtimeCore.Cleanup();
         return nWarnings + nErrors;
     }
     TestFrameWork thisTest = new TestFrameWork();
     foreach (var item in data)
     {
         if (item.ExpectedValue == null)
         {
             object nullOb = null;
             TestFrameWork.Verify(mirror, item.ValueName, nullOb, item.BlockIndex);
         }
         else
         {
             TestFrameWork.Verify(mirror, item.ValueName, item.ExpectedValue, item.BlockIndex);
         }
     }
     runtimeCore.Cleanup();
     return nWarnings + nErrors;
 }
开发者ID:sh4nnongoh,项目名称:Dynamo,代码行数:30,代码来源:CSFFITest.cs

示例5: SimpleMethodOverload2

            runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
            Assert.IsTrue((Int64)mirror.GetValue("x").Payload == 123);
            Assert.IsTrue((Int64)mirror.GetValue("y").Payload == 345);
        }

        [Test]
        [Category("DSDefinedClass_Ported")]
        public void SimpleMethodOverload2()
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:8,代码来源:MethodResolution.cs

示例6: scale

        return = 0;
	}
	x = 10;
    y = 40;
	n = scale();
	n = scale(10);
";
            ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
            runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:9,代码来源:MethodResolution.cs

示例7: SimpleMethodOverload1

            ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
            runtimeCore = fsr.Execute(code, core); ExecutionMirror mirror = runtimeCore.Mirror;
            Assert.IsTrue((Int64)mirror.GetValue("x").Payload == 123);
            Assert.IsTrue((Int64)mirror.GetValue("y").Payload == 345);
        }

        [Test]
        [Category("DSDefinedClass_Ported")]
        public void SimpleMethodOverload1()
开发者ID:ankushraizada,项目名称:Dynamo,代码行数:9,代码来源:MethodResolution.cs

示例8: ParserFailTest2

     });
 }
 [Test]
 public void ParserFailTest2()
 {
     ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
     //@TODO: What exception should this throw
     Assert.Throws(typeof(ProtoCore.Exceptions.CompileErrorsOccured), () =>
     {
         fsr.Execute(
开发者ID:lewshion,项目名称:Dynamo,代码行数:10,代码来源:ProtoScriptTest.cs

示例9: TestMultLanguageImperativeAssociative

    b = 4;
}
", core, out runtimeCore);
        }
        [Test]
        public void TestMultLanguageImperativeAssociative()
        {
            ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
            fsr.Execute(
@"
开发者ID:lewshion,项目名称:Dynamo,代码行数:10,代码来源:MultiLanugageBasic.cs

示例10: SimpleExpr

 public void SimpleExpr()
 {
     ProtoScript.Runners.ProtoScriptRunner fsr = new ProtoScript.Runners.ProtoScriptRunner();
     runtimeCore = fsr.Execute(
                 @"
                 [Associative]
                 {
                     a = 10;
                 }
                 ", core);
 }
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:11,代码来源:ModifierStack.cs

示例11: RedefineWithFunctions03

        public void RedefineWithFunctions03()
        {
            String code =
@"
class C
{
    mx : var;
    constructor C()
开发者ID:lewshion,项目名称:Dynamo,代码行数:8,代码来源:RedefinitionExpression.cs

示例12: f

    }
    def f(a : int)
    {
        mx = a + 1;
        return = mx;
    }
}
x = 10;
开发者ID:lewshion,项目名称:Dynamo,代码行数:8,代码来源:RedefinitionExpression.cs

示例13:

 ExecutionMirror mirror = thisTest.RunScriptSource(code);
 thisTest.Verify("f0", false);
 thisTest.Verify("f1", false);
 thisTest.Verify("f2", false);
 thisTest.Verify("f3", false);
 thisTest.Verify("t0", true);
 thisTest.Verify("t1", true);
 thisTest.Verify("t2", true);
开发者ID:lewshion,项目名称:Dynamo,代码行数:8,代码来源:FromOldTestSuite.cs

示例14: PreClarifyPreParseBracket001

        public void PreClarifyPreParseBracket001()
        {
            String code =
@"x;
[Associative]
{
 a = {1001,1002};    
 // This is failing the pre-parse. 
 // Probably has somthing to do with convertingthe language blocks into binary exprs
开发者ID:lewshion,项目名称:Dynamo,代码行数:9,代码来源:ProtoCoreLexerTests.cs

示例15: LiteralRetrival

        public void LiteralRetrival()
        {
            String code =
@"
foo;
[Associative]
{
	foo = 5;
}
开发者ID:lewshion,项目名称:Dynamo,代码行数:9,代码来源:ExecutionMirrorTests.cs


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