Beispiel #1
0
          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);
            }
        }
        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.PushFalse();
            context.newobj(Runtime.Range.ctor);

            context.ReleaseLocal(start, start_created);
            context.ReleaseLocal(finish, finish_created);
        }
 public void GenSimple(CodeGenContext context)
 {
     context.PushFalse();
     context.box(PrimitiveType.Boolean);
 }