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 // }