• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CSharp.FlowBranching类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mono.CSharp.FlowBranching的典型用法代码示例。如果您正苦于以下问题:C# FlowBranching类的具体用法?C# FlowBranching怎么用?C# FlowBranching使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FlowBranching类属于Mono.CSharp命名空间,在下文中一共展示了FlowBranching类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateBranching

		public static FlowBranching CreateBranching (FlowBranching parent, BranchingType type, Block block, Location loc)
		{
			switch (type) {
			case BranchingType.Exception:
			case BranchingType.Labeled:
			case BranchingType.Toplevel:
			case BranchingType.TryCatch:
				throw new InvalidOperationException ();

			case BranchingType.Switch:
				return new FlowBranchingBreakable (parent, type, SiblingType.SwitchSection, block, loc);

			case BranchingType.Block:
				return new FlowBranchingBlock (parent, type, SiblingType.Block, block, loc);

			case BranchingType.Loop:
				return new FlowBranchingBreakable (parent, type, SiblingType.Conditional, block, loc);

			case BranchingType.Embedded:
				return new FlowBranchingContinuable (parent, type, SiblingType.Conditional, block, loc);

			default:
				return new FlowBranchingBlock (parent, type, SiblingType.Conditional, block, loc);
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:25,代码来源:flowanalysis.cs


示例2: FlowBranching

        // <summary>
        //   Creates a new flow branching which is contained in `parent'.
        //   You should only pass non-null for the `block' argument if this block
        //   introduces any new variables - in this case, we need to create a new
        //   usage vector with a different size than our parent's one.
        // </summary>
        protected FlowBranching(FlowBranching parent, BranchingType type, SiblingType stype,
            Block block, Location loc)
        {
            Parent = parent;
            Block = block;
            Location = loc;
            Type = type;
            id = ++next_id;

            UsageVector vector;
            if (Block != null) {
                UsageVector parent_vector = parent != null ? parent.CurrentUsageVector : null;
                vector = new UsageVector (stype, parent_vector, Block, loc, Block.AssignableSlots);
            } else {
                vector = new UsageVector (stype, Parent.CurrentUsageVector, null, loc);
            }

            AddSibling (vector);
        }
开发者ID:speier,项目名称:shake,代码行数:25,代码来源:flowanalysis.cs


示例3: DoPropagateFinally

			protected override void DoPropagateFinally (FlowBranching parent)
			{
				parent.AddContinueOrigin (Vector, Loc);
			}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:4,代码来源:flowanalysis.cs


示例4: IsFullyInitialized

		// <summary>
		//   A struct's constructor must always assign all fields.
		//   This method checks whether it actually does so.
		// </summary>
		public bool IsFullyInitialized (FlowBranching branching, VariableInfo vi, Location loc)
		{
			if (struct_info == null)
				return true;

			bool ok = true;
			for (int i = 0; i < struct_info.Count; i++) {
				FieldInfo field = struct_info.Fields [i];

				if (!branching.IsFieldAssigned (vi, field.Name)) {
					FieldBase fb = TypeManager.GetField (field);
					if (fb != null && (fb.ModFlags & Modifiers.BACKING_FIELD) != 0) {
						Report.Error (843, loc,
							"An automatically implemented property `{0}' must be fully assigned before control leaves the constructor. Consider calling default contructor",
							fb.GetSignatureForError ());
					} else {
						Report.Error (171, loc,
							"Field `{0}' must be fully assigned before control leaves the constructor",
							TypeManager.GetFullNameSignature (field));
					}
					ok = false;
				}
			}

			return ok;
		}
开发者ID:lewurm,项目名称:benchmarker,代码行数:30,代码来源:flowanalysis.cs


示例5: PropagateFinally

			public void PropagateFinally (UsageVector finally_vector, FlowBranching parent)
			{
				if (finally_vector != null)
					Vector.MergeChild (finally_vector, false);
				DoPropagateFinally (parent);
			}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:6,代码来源:flowanalysis.cs


示例6: StartFlowBranching

		public FlowBranchingIterator StartFlowBranching (StateMachineInitializer iterator, FlowBranching parent)
		{
			FlowBranchingIterator branching = new FlowBranchingIterator (parent, iterator);
			current_flow_branching = branching;
			return branching;
		}
开发者ID:jkells,项目名称:mono,代码行数:6,代码来源:context.cs


示例7: EndFlowBranching

		// <summary>
		//   Ends a code branching.  Merges the state of locals and parameters
		//   from all the children of the ending branching.
		// </summary>
		public bool EndFlowBranching ()
		{
			FlowBranching old = current_flow_branching;
			current_flow_branching = current_flow_branching.Parent;

			FlowBranching.UsageVector vector = current_flow_branching.MergeChild (old);
			return vector.IsUnreachable;
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:12,代码来源:context.cs


示例8: StartFlowBranching

		// <summary>
		//   Starts a new code branching.  This inherits the state of all local
		//   variables and parameters from the current branching.
		// </summary>
		public FlowBranching StartFlowBranching (FlowBranching.BranchingType type, Location loc)
		{
			current_flow_branching = FlowBranching.CreateBranching (CurrentBranching, type, null, loc);
			return current_flow_branching;
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:9,代码来源:context.cs


示例9: FlowBranchingLabeled

		public FlowBranchingLabeled (FlowBranching parent, LabeledStatement stmt)
			: base (parent, BranchingType.Labeled, SiblingType.Conditional, null, stmt.loc)
		{
			this.stmt = stmt;
			CurrentUsageVector.MergeOrigins (stmt.JumpOrigins);
			actual = CurrentUsageVector.Clone ();

			// stand-in for backward jumps
			CurrentUsageVector.ResetBarrier ();
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:10,代码来源:flowanalysis.cs


示例10: FlowBranchingIterator

		public FlowBranchingIterator (FlowBranching parent, Iterator iterator)
			: base (parent, BranchingType.Iterator, SiblingType.Block, iterator.Block, iterator.Location)
		{
			this.iterator = iterator;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs


示例11: MergeChild

		public UsageVector MergeChild (FlowBranching child)
		{
			return CurrentUsageVector.MergeChild (child.Merge (), true);
 		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:4,代码来源:flowanalysis.cs


示例12: FlowBranchingContinuable

		public FlowBranchingContinuable (FlowBranching parent, BranchingType type, SiblingType stype, Block block, Location loc)
			: base (parent, type, stype, block, loc)
		{ }
开发者ID:yayanyang,项目名称:monodevelop,代码行数:3,代码来源:flowanalysis.cs


示例13: AddUsageVector

		public void AddUsageVector (FlowBranching.UsageVector vector)
		{
			vector = vector.Clone ();
			vector.Next = vectors;
			vectors = vector;
		}
开发者ID:alisci01,项目名称:mono,代码行数:6,代码来源:statement.cs


示例14: Resolve

		public bool Resolve (FlowBranching parent, BlockContext rc, IMethodData md)
		{
			if (resolved)
				return true;

			resolved = true;

			if (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))
				flags |= Flags.IsExpressionTree;

			try {
				ResolveMeta (rc);

				using (rc.With (ResolveContext.Options.DoFlowAnalysis, true)) {
					FlowBranchingToplevel top_level = rc.StartFlowBranching (this, parent);

					if (!Resolve (rc))
						return false;

					unreachable = top_level.End ();
				}
			} catch (Exception e) {
				if (e is CompletionResult || rc.Report.IsDisabled)
					throw;

				if (rc.CurrentBlock != null) {
					rc.Report.Error (584, rc.CurrentBlock.StartLocation, "Internal compiler error: {0}", e.Message);
				} else {
					rc.Report.Error (587, "Internal compiler error: {0}", e.Message);
				}

				if (Report.DebugFlags > 0)
					throw;
			}

			if (rc.ReturnType != TypeManager.void_type && !unreachable) {
				if (rc.CurrentAnonymousMethod == null) {
					// FIXME: Missing FlowAnalysis for generated iterator MoveNext method
					if (md is IteratorMethod) {
						unreachable = true;
					} else {
						rc.Report.Error (161, md.Location, "`{0}': not all code paths return a value", md.GetSignatureForError ());
						return false;
					}
				} else {
					rc.Report.Error (1643, rc.CurrentAnonymousMethod.Location, "Not all code paths return a value in anonymous method of type `{0}'",
							  rc.CurrentAnonymousMethod.GetSignatureForError ());
					return false;
				}
			}

			return true;
		}
开发者ID:alisci01,项目名称:mono,代码行数:53,代码来源:statement.cs


示例15: CheckOutParameters

		// <summary>
		//   Check whether all `out' parameters have been assigned.
		// </summary>
		public void CheckOutParameters (FlowBranching.UsageVector vector, Location loc)
		{
			if (vector.IsUnreachable)
				return;

			int n = parameter_info == null ? 0 : parameter_info.Length;

			for (int i = 0; i < n; i++) {
				VariableInfo var = parameter_info[i].VariableInfo;

				if (var == null)
					continue;

				if (vector.IsAssigned (var, false))
					continue;

				TopBlock.Report.Error (177, loc, "The out parameter `{0}' must be assigned to before control leaves the current method",
					var.Name);
			}
		}
开发者ID:alisci01,项目名称:mono,代码行数:23,代码来源:statement.cs


示例16: FlowBranchingToplevel

		public FlowBranchingToplevel (FlowBranching parent, ParametersBlock stmt)
			: base (parent, BranchingType.Toplevel, SiblingType.Conditional, stmt, stmt.loc)
		{
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:4,代码来源:flowanalysis.cs


示例17: FlowBranchingTryFinally

		public FlowBranchingTryFinally (FlowBranching parent,
					       ExceptionStatement stmt)
			: base (parent, BranchingType.Exception, SiblingType.Try,
				null, stmt.loc)
		{
			this.stmt = stmt;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:7,代码来源:flowanalysis.cs


示例18: FlowBranchingTryCatch

		public FlowBranchingTryCatch (FlowBranching parent, TryCatch stmt)
			: base (parent, BranchingType.Block, SiblingType.Try, null, stmt.loc)
		{
			this.tc = stmt;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs


示例19: FlowBranchingAsync

		public FlowBranchingAsync (FlowBranching parent, AsyncInitializer async_init)
			: base (parent, BranchingType.Block, SiblingType.Try, null, async_init.Location)
		{
			this.async_init = async_init;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs


示例20: KillFlowBranching

		// <summary>
		//   Kills the current code branching.  This throws away any changed state
		//   information and should only be used in case of an error.
		// </summary>
		// FIXME: this is evil
		public void KillFlowBranching ()
		{
			current_flow_branching = current_flow_branching.Parent;
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:9,代码来源:context.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CSharp.For类代码示例发布时间:2022-05-26
下一篇:
C# CSharp.FlowAnalysisContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap