Ejemplo n.º 1
0
            public DisposeMethod(IteratorStorey host)
                : base(host, new TypeExpression(host.Compiler.BuiltinTypes.Void, host.Location), Modifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN,
                       new MemberName("Dispose", host.Location))
            {
                host.AddMethod(this);

                Block.AddStatement(new DisposeMethodStatement(host.Iterator));
            }
Ejemplo n.º 2
0
            public DisposeMethod(IteratorStorey host)
                : base(host, TypeManager.system_void_expr, Modifiers.PUBLIC, new MemberName("Dispose", host.Location))
            {
                host.AddMethod(this);

                Block = new ToplevelBlock(host.Iterator.Container, Parameters.EmptyReadOnlyParameters, Location);
                Block.AddStatement(new DisposeMethodStatement(host.Iterator));
            }
Ejemplo n.º 3
0
        protected override Expression DoResolve(ResolveContext ec)
        {
            IteratorHost = (IteratorStorey)block.TopBlock.AnonymousMethodStorey;

            BlockContext ctx = new BlockContext(ec, block, ReturnType);

            ctx.CurrentAnonymousMethod = this;

            ctx.StartFlowBranching(this, ec.CurrentBranching);
            Block.Resolve(ctx);
            ctx.EndFlowBranching();

            var move_next = new IteratorMethod(IteratorHost, new TypeExpression(ec.BuiltinTypes.Bool, loc),
                                               Modifiers.PUBLIC, new MemberName("MoveNext", Location));

            move_next.Block.AddStatement(new MoveNextMethodStatement(this));
            IteratorHost.AddMethod(move_next);

            eclass = ExprClass.Value;
            return(this);
        }
Ejemplo n.º 4
0
            public DisposeMethod(IteratorStorey host)
                : base(host, TypeManager.system_void_expr, Modifiers.PUBLIC, new MemberName ("Dispose", host.Location))
            {
                host.AddMethod (this);

                Block = new ToplevelBlock (Compiler, host.Iterator.Container, ParametersCompiled.EmptyReadOnlyParameters, Location);
                Block.AddStatement (new DisposeMethodStatement (host.Iterator));
            }
Ejemplo n.º 5
0
		protected override Expression DoResolve (ResolveContext ec)
		{
			IteratorHost = (IteratorStorey) block.TopBlock.AnonymousMethodStorey;

			BlockContext ctx = new BlockContext (ec, block, ReturnType);
			ctx.CurrentAnonymousMethod = this;

			ctx.StartFlowBranching (this, ec.CurrentBranching);
			Block.Resolve (ctx);
			ctx.EndFlowBranching ();

			var move_next = new IteratorMethod (IteratorHost, new TypeExpression (TypeManager.bool_type, loc),
				Modifiers.PUBLIC, new MemberName ("MoveNext", Location));
			move_next.Block.AddStatement (new MoveNextMethodStatement (this));
			IteratorHost.AddMethod (move_next);

			eclass = ExprClass.Value;
			return this;
		}
Ejemplo n.º 6
0
			public DisposeMethod (IteratorStorey host)
				: base (host, new TypeExpression (TypeManager.void_type, host.Location), Modifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN,
					new MemberName ("Dispose", host.Location))
			{
				host.AddMethod (this);

				Block.AddStatement (new DisposeMethodStatement (host.Iterator));
			}