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


C# CloneContext.AddBlockMap方法代码示例

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


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

示例1: CloneTo

		protected override void CloneTo (CloneContext clonectx, Statement t)
		{
			Block target = (Block) t;
#if DEBUG
			target.clone_id = clone_id_counter++;
#endif

			clonectx.AddBlockMap (this, target);

			target.ParametersBlock = (ParametersBlock) (ParametersBlock == this ? target : clonectx.RemapBlockCopy (ParametersBlock));
			target.Explicit = (ExplicitBlock) (Explicit == this ? target : clonectx.LookupBlock (Explicit));

			if (Parent != null)
				target.Parent = clonectx.RemapBlockCopy (Parent);

			target.statements = new List<Statement> (statements.Count);
			foreach (Statement s in statements)
				target.statements.Add (s.Clone (clonectx));
		}
开发者ID:alisci01,项目名称:mono,代码行数:19,代码来源:statement.cs

示例2: CloneTo

		protected override void CloneTo (CloneContext clonectx, Statement t)
		{
			Block target = (Block) t;

			clonectx.AddBlockMap (this, target);

			target.Toplevel = (ToplevelBlock) clonectx.LookupBlock (Toplevel);
			target.Explicit = (ExplicitBlock) clonectx.LookupBlock (Explicit);
			if (Parent != null)
				target.Parent = clonectx.RemapBlockCopy (Parent);

			if (variables != null){
				target.variables = new Dictionary<string, LocalInfo> ();

				foreach (var de in variables){
					LocalInfo newlocal = de.Value.Clone (clonectx);
					target.variables [de.Key] = newlocal;
					clonectx.AddVariableMap (de.Value, newlocal);
				}
			}

			target.statements = new List<Statement> (statements.Count);
			foreach (Statement s in statements)
				target.statements.Add (s.Clone (clonectx));

			if (target.children != null){
				target.children = new List<Block> (children.Count);
				foreach (Block b in children){
					target.children.Add (clonectx.LookupBlock (b));
				}
			}

			//
			// TODO: labels, switch_block, constants (?), anonymous_children
			//
		}
开发者ID:tgiphil,项目名称:mono,代码行数:36,代码来源:statement.cs


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