コード例 #1
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));
            }
コード例 #2
0
            public static GetEnumeratorMethod Create(IteratorStorey host, FullNamedExpression returnType, MemberName name, Statement statement)
            {
                var m    = new GetEnumeratorMethod(host, returnType, name);
                var stmt = statement ?? new GetEnumeratorStatement(host, m);

                m.block.AddStatement(stmt);
                return(m);
            }
コード例 #3
0
            public DisposeMethod(IteratorStorey host)
                : base(host, null, new TypeExpression(host.Compiler.BuiltinTypes.Void, host.Location), Modifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN,
                       new MemberName("Dispose", host.Location), ToplevelBlock.Flags.CompilerGenerated | ToplevelBlock.Flags.NoFlowAnalysis)
            {
                host.Members.Add(this);

                Block.AddStatement(new DisposeMethodStatement(host.Iterator));
            }
コード例 #4
0
ファイル: iterators.cs プロジェクト: nuxleus/mono
            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));
            }
コード例 #5
0
ファイル: iterators.cs プロジェクト: nuxleus/mono
        public IteratorMethod(IteratorStorey host, FullNamedExpression returnType, Modifiers mod, MemberName name)
            : base(host, null, returnType, mod | Modifiers.COMPILER_GENERATED,
                   name, ParametersCompiled.EmptyReadOnlyParameters, null)
        {
            this.host = host;

            Block = new ToplevelBlock(host.Compiler, ParametersCompiled.EmptyReadOnlyParameters, Location);
        }
コード例 #6
0
            public IteratorMethod(IteratorStorey host, FullNamedExpression returnType, int mod, MemberName name)
                : base(host, null, returnType, mod | Modifiers.DEBUGGER_HIDDEN | Modifiers.COMPILER_GENERATED,
                       name, Parameters.EmptyReadOnlyParameters, null)
            {
                this.host = host;

                Block = new ToplevelBlock(host.Iterator.Container.Toplevel, Parameters.EmptyReadOnlyParameters, Location);
            }
コード例 #7
0
ファイル: iterators.cs プロジェクト: speier/shake
        //
        // Our constructor
        //
        private Iterator(CompilerContext ctx, IMethodData method, TypeContainer host, TypeSpec iterator_type, bool is_enumerable)
            : base(new ToplevelBlock (ctx, method.Block, ParametersCompiled.EmptyReadOnlyParameters, method.Block.StartLocation),
				TypeManager.bool_type,
				method.Location)
        {
            this.OriginalMethod = method;
            this.OriginalIteratorType = iterator_type;
            this.IsEnumerable = is_enumerable;
            this.Host = host;
            this.type = method.ReturnType;

            IteratorHost = Block.ChangeToIterator (this, method.Block);
        }
コード例 #8
0
        //
        // Our constructor
        //
        private Iterator(IMethodData method, TypeContainer host, Type iterator_type, bool is_enumerable)
            : base(
                new ToplevelBlock(method.Block, Parameters.EmptyReadOnlyParameters, method.Block.StartLocation),
                TypeManager.bool_type,
                method.Location)
        {
            this.OriginalMethod       = method;
            this.OriginalIteratorType = iterator_type;
            this.IsEnumerable         = is_enumerable;
            this.Host = host;

            IteratorHost = Block.ChangeToIterator(this, method.Block);
        }
コード例 #9
0
ファイル: iterators.cs プロジェクト: nuxleus/mono
        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);
        }
コード例 #10
0
ファイル: statement.cs プロジェクト: alisci01/mono
		public void WrapIntoIterator (IMethodData method, TypeContainer host, TypeSpec iterator_type, bool is_enumerable)
		{
			ParametersBlock pb = new ParametersBlock (this, ParametersCompiled.EmptyReadOnlyParameters, StartLocation);
			pb.EndLocation = EndLocation;
			pb.statements = statements;

			var iterator = new Iterator (pb, method, host, iterator_type, is_enumerable);
			am_storey = new IteratorStorey (iterator);

			statements = new List<Statement> (1);
			AddStatement (new Return (iterator, iterator.Location));
		}
コード例 #11
0
ファイル: iterators.cs プロジェクト: nuxleus/mono
 public GetEnumeratorMethod(IteratorStorey host, FullNamedExpression returnType, MemberName name)
     : base(host, returnType, Modifiers.DEBUGGER_HIDDEN, name)
 {
     Block.AddStatement(new GetEnumeratorStatement(host, this));
 }
コード例 #12
0
ファイル: iterators.cs プロジェクト: Tak/monodevelop-novell
			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));
			}
コード例 #13
0
ファイル: iterators.cs プロジェクト: speier/shake
 public GetEnumeratorStatement(IteratorStorey host, IteratorMethod host_method)
 {
     this.host = host;
     this.host_method = host_method;
     loc = host_method.Location;
 }
コード例 #14
0
 public static GetEnumeratorMethod Create(IteratorStorey host, FullNamedExpression returnType, MemberName name)
 {
     return(Create(host, returnType, name, null));
 }
コード例 #15
0
 GetEnumeratorMethod(IteratorStorey host, FullNamedExpression returnType, MemberName name)
     : base(host, null, returnType, Modifiers.DEBUGGER_HIDDEN, name, ToplevelBlock.Flags.CompilerGenerated | ToplevelBlock.Flags.NoFlowAnalysis)
 {
 }
コード例 #16
0
ファイル: statement.cs プロジェクト: tgiphil/mono
		//
		// Reformats this block to be top-level iterator block
		//
		public IteratorStorey ChangeToIterator (Iterator iterator, ToplevelBlock source)
		{
			IsIterator = true;

			// Creates block with original statements
			AddStatement (new IteratorStatement (iterator, new Block (this, source)));

			source.statements = new List<Statement> (1);
			source.AddStatement (new Return (iterator, iterator.Location));
			source.IsIterator = false;

			IteratorStorey iterator_storey = new IteratorStorey (iterator);
			source.am_storey = iterator_storey;
			return iterator_storey;
		}
コード例 #17
0
 GetEnumeratorMethod(IteratorStorey host, FullNamedExpression returnType, MemberName name)
     : base(host, null, returnType, Modifiers.DEBUGGER_HIDDEN, name)
 {
 }
コード例 #18
0
ファイル: iterators.cs プロジェクト: Tak/monodevelop-novell
		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;
		}
コード例 #19
0
ファイル: iterators.cs プロジェクト: speier/shake
            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));
            }
コード例 #20
0
ファイル: iterators.cs プロジェクト: speier/shake
 public GetEnumeratorMethod(IteratorStorey host, FullNamedExpression returnType, MemberName name)
     : base(host, returnType, 0, name)
 {
     Block.AddStatement (new GetEnumeratorStatement (host, this));
 }
コード例 #21
0
ファイル: iterators.cs プロジェクト: nuxleus/mono
 public GetEnumeratorStatement(IteratorStorey host, IteratorMethod host_method)
 {
     this.host        = host;
     this.host_method = host_method;
     loc = host_method.Location;
 }
コード例 #22
0
ファイル: iterators.cs プロジェクト: speier/shake
            public IteratorMethod(IteratorStorey host, FullNamedExpression returnType, Modifiers mod, MemberName name)
                : base(host, null, returnType, mod | Modifiers.DEBUGGER_HIDDEN | Modifiers.COMPILER_GENERATED,
				  name, ParametersCompiled.EmptyReadOnlyParameters, null)
            {
                this.host = host;

                Block = new ToplevelBlock (Compiler, host.Iterator.Container.Toplevel, ParametersCompiled.EmptyReadOnlyParameters, Location);
            }
コード例 #23
0
ファイル: iterators.cs プロジェクト: lewurm/benchmarker
		//
		// Our constructor
		//
		private Iterator (IMethodData method, TypeContainer host, Type iterator_type, bool is_enumerable)
			: base (
				new ToplevelBlock (method.Block, Parameters.EmptyReadOnlyParameters, method.Block.StartLocation),
				TypeManager.bool_type,
				method.Location)
		{
			this.OriginalMethod = method;
			this.OriginalIteratorType = iterator_type;
			this.IsEnumerable = is_enumerable;
			this.Host = host;

			IteratorHost = Block.ChangeToIterator (this, method.Block);
		}