internal override Statement CloneInternal(CloneContext ctx) { IfStatement clone = new IfStatement(); ctx.Map(this, clone); foreach (Expression e in Conditions) clone.Conditions.Add(e); foreach (Statement b in Branches) clone.Branches.Add(b.GetClone(ctx)); return clone; }
internal override Statement CloneInternal(CloneContext ctx) { CaseStatement clone = new CaseStatement() { Selector = this.Selector }; ctx.Map(this, clone); foreach (Expression e in Cases) clone.Cases.Add(e); foreach (Statement b in Branches) clone.Branches.Add(b.GetClone(ctx)); return clone; }
internal override Statement CloneInternal(CloneContext ctx) { return new GotoCaseStatement() { CaseStmt = (CaseStatement)ctx.Map(CaseStmt), TargetIndex = this.TargetIndex }; }
internal override Statement CloneInternal(CloneContext ctx) { GotoStatement result = new GotoStatement(); if (Target != null) ctx.Complete += () => result.Target = ctx.Map(Target); return result; }
internal override Statement CloneInternal(CloneContext ctx) { return new BreakCaseStatement() { CaseStmt = (CaseStatement)ctx.Map(CaseStmt) }; }
internal override Statement CloneInternal(CloneContext ctx) { return new ContinueLoopStatement() { Loop = (LoopBlock)ctx.Map(Loop) }; }
internal override Statement CloneInternal(CloneContext ctx) { LoopBlock loop = new LoopBlock(); ctx.Map(this, loop); loop.Body = Body.GetClone(ctx); return loop; }
internal override Statement CloneInternal(CloneContext ctx) { CompoundStatement clone = new CompoundStatement(); ctx.Map(this, clone); foreach (Statement stmt in Statements) { if (!stmt.IsEliminated) clone.Statements.Add(stmt.GetClone(ctx)); } return clone; }
internal Statement GetClone(CloneContext ctx) { Statement clone = CloneInternal(ctx); ctx.Map(this, clone); clone.Label = Label; clone.CopyAttributesFrom(this); return clone; }