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


C# CodeGenContext.PushTrue方法代码示例

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


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

示例1: Defined

   internal override void Defined(CodeGenContext context)
 {
     context.PushTrue();
     context.box(PrimitiveType.Boolean);
 }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:5,代码来源:Variables.cs

示例2: GenCode0

        internal override void GenCode0(CodeGenContext context)
        {
            bool start_created, finish_created;
            ISimple start = context.PreCompute(beg, "beg", out start_created);
            ISimple finish = context.PreCompute(end, "end", out finish_created);

            start.GenSimple(context);
            finish.GenSimple(context);
            context.PushTrue();
            context.newobj(Runtime.Range.ctor);

            context.ReleaseLocal(start, start_created);
            context.ReleaseLocal(finish, finish_created);
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:14,代码来源:Operators.cs

示例3: GenCode

        internal void GenCode(CodeGenContext context, PERWAPI.CILLabel endLabel, int RescueTemp, int exception)
        {
            for (RESCUE_CLAUSE clause = this; clause != null; clause = clause.next)
            {
                PERWAPI.CILLabel nextClause = context.NewLabel();
                PERWAPI.CILLabel thisClause = context.NewLabel();

                context.ldc_i4(0);
                LOCAL exceptionCaught = context.StoreInLocal("caught", PERWAPI.PrimitiveType.Boolean, this.location);

                for (Node type = clause.types; type != null; type = type.nd_next)
                {
                    PERWAPI.CILLabel label1 = context.NewLabel();

                    // Precompute each separately to avoid computing a list of types
                    type.GenCode0(context);
                    LOCAL tt = context.StoreInLocal("type", PERWAPI.PrimitiveType.Object, type.location);

                    new METHOD_CALL(tt, ID.intern(Tokens.tEQQ), new AST.LOCAL(exception, type.location), type.location).GenCode(context);

                    context.ReleaseLocal(tt.local, true);

                    context.call(Runtime.Eval.Test);
                    context.brfalse(label1);
                    context.PushTrue();
                    context.stloc(exceptionCaught.local);
                    context.CodeLabel(label1);                  
                }

                context.ldloc(exceptionCaught.local);
                context.brtrue(thisClause);
                context.ReleaseLocal(exceptionCaught.local, true);

                context.br(nextClause);

                context.CodeLabel(thisClause);

                if (clause.var != null)
                {
                    clause.var.Assign(context, new AST.LOCAL(exception, clause.var.location));
                    context.pop();
                }

                if (clause.body != null)
                    clause.body.GenCode(context);
                else
                    context.ldnull();

                if (context.Reachable())
                    context.stloc(RescueTemp);

                // reset $!
                //Eval.ruby_errinfo.value = null;
                context.ldsfld(Runtime.Eval.ruby_errinfo);
                context.ldnull();
                context.stfld(Runtime.global_variable.value);

                context.Goto(endLabel);

                context.CodeLabel(nextClause);
            }
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:62,代码来源:Exceptions.cs

示例4: Defined

          internal override void Defined(CodeGenContext context)
        {
            PERWAPI.CILLabel undefined_label = context.NewLabel();
            PERWAPI.CILLabel end_label = context.NewLabel();

            for (Node arg = parameters; arg != null; arg = arg.nd_next)
            {
                arg.Defined(context);
                context.brfalse(undefined_label);
            }

            if (array != null)
            {
                array.Defined(context);
                context.brfalse(undefined_label);
            }

            if (hashlist != null)
            {
                hashlist.Defined(context);
                context.brfalse(undefined_label);
            }

            if (block != null)
            {
                block.Defined(context);
                context.brfalse(undefined_label);
            }

            context.PushTrue();
            context.box(PrimitiveType.Boolean);

            if (!IsEmpty)
            {
                context.br(end_label);

                context.CodeLabel(undefined_label);
                context.PushFalse();
                context.box(PrimitiveType.Boolean);

                context.CodeLabel(end_label);
            }
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:43,代码来源:Args.cs

示例5: GenArgList

        internal override ISimple GenArgList(CodeGenContext context, out bool created)
        {
            bool single = true;

            // ArgList arglist = new ArgList();
            context.newobj(Runtime.ArgList.ctor);
            int arglist = context.StoreInTemp("arglist", Runtime.ArgListRef, location);

            int added = 0;
            for (Node arg = parameters; arg != null; arg = arg.nd_next)
            {
                //object argument = arg;
                bool argument_created;
                ISimple argument = context.PreCompute0(arg, "arg", out argument_created);

                // arglist.Add(argument);
                context.ldloc(arglist);
                argument.GenSimple(context);
                context.callvirt(Runtime.ArgList.Add);
                added++;

                context.ReleaseLocal(argument, argument_created);
            }

            if (added != 1)
                single = false;

            if (hashlist != null)
            {
                // object hash = hashlist;
                bool hash_created;
                ISimple hash = context.PreCompute(new HASH(hashlist, hashlist.location), "hashlist", out hash_created);

                // arglist.Add(hash);
                context.ldloc(arglist);
                hash.GenSimple(context);
                context.callvirt(Runtime.ArgList.Add);
                single = false;

                context.ReleaseLocal(hash, hash_created);
            }

            if (array != null)
            {
                // object list = array;
                bool list_created;
                ISimple list = context.PreCompute(array, "array", out list_created);

                // arglist.AddArray(list, caller);
                context.ldloc(arglist);
                list.GenSimple(context);
                context.ldloc(0);
                context.callvirt(Runtime.ArgList.AddArray);
                single = false;

                context.ReleaseLocal(list, list_created);
            }

            if (block != null)
            {
                // object b = block;
                bool b_created;
                ISimple b = context.PreCompute(block, "block", Runtime.ProcRef, out b_created);

                // arglist.block = b;
                context.ldloc(arglist);
                b.GenSimple(context);
                context.stfld(Runtime.ArgList.block);

                context.ReleaseLocal(b, b_created);
            }

            if (single)
            {
                context.ldloc(arglist);
                context.PushTrue();
                context.stfld(Runtime.ArgList.single_arg);
            }

            created = true;
            return new LOCAL(arglist, location);
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:82,代码来源:Args.cs

示例6: GenSimple

 public void GenSimple(CodeGenContext context)
 {
     context.PushTrue();
     context.box(PrimitiveType.Boolean);
 }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:5,代码来源:Singletons.cs


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