protected override void CloneTo(CloneContext clonectx, Statement target) { throw new NotSupportedException (); }
protected override void CloneTo (CloneContext clonectx, Expression t) { // Nothing }
public Argument Clone (CloneContext clonectx) { Argument a = (Argument) MemberwiseClone (); a.Expr = Expr.Clone (clonectx); return a; }
protected override void CloneTo(CloneContext clonectx, Statement t) { Yield target = (Yield) t; target.expr = expr.Clone (clonectx); }
public Statement PerformClone () { CloneContext clonectx = new CloneContext (); return Clone (clonectx); }
protected override Expression DoResolve (ResolveContext ec) { CloneContext cc = new CloneContext (); Expression clone = source.Clone (cc); // // A useful feature for the REPL: if we can resolve the expression // as a type, Describe the type; // if (Evaluator.DescribeTypeExpressions){ var old_printer = Evaluator.SetPrinter (new StreamReportPrinter (TextWriter.Null)); clone = clone.Resolve (ec); if (clone == null){ clone = source.Clone (cc); clone = clone.Resolve (ec, ResolveFlags.Type); if (clone == null){ Evaluator.SetPrinter (old_printer); clone = source.Clone (cc); clone = clone.Resolve (ec); return null; } Arguments args = new Arguments (1); args.Add (new Argument (new TypeOf ((TypeExpr) clone, Location))); source = new Invocation (new SimpleName ("Describe", Location), args).Resolve (ec); } Evaluator.SetPrinter (old_printer); } else { clone = clone.Resolve (ec); if (clone == null) return null; } // This means its really a statement. if (clone.Type == TypeManager.void_type){ source = source.Resolve (ec); target = null; type = TypeManager.void_type; eclass = ExprClass.Value; return this; } return base.DoResolve (ec); }
protected override void CloneTo (CloneContext clonectx, Statement t) { Fixed target = (Fixed) t; target.decl = (VariableDeclaration) decl.Clone (clonectx); target.statement = statement.Clone (clonectx); }
protected override void CloneTo (CloneContext clonectx, Expression t) { AnonymousMethodExpression target = (AnonymousMethodExpression) t; target.Block = (ParametersBlock) clonectx.LookupBlock (Block); }
protected override void CloneTo(CloneContext clonectx, Expression target) { // TODO: nothing ?? }
public Argument Clone(CloneContext clonectx) { return(Clone(Expr.Clone(clonectx))); }
protected override void CloneTo(CloneContext clonectx, Expression target) { var t = (Await)target; t.expr = expr.Clone(clonectx); }
protected override void CloneTo(CloneContext clonectx, Statement target) { throw new NotSupportedException(); }
protected override void CloneTo(CloneContext clonectx, Statement t) { var target = (YieldStatement <T>)t; target.expr = expr.Clone(clonectx); }
protected override void CloneTo (CloneContext clonectx, Expression t) { CompoundAssign ctarget = (CompoundAssign) t; ctarget.right = ctarget.source = source.Clone (clonectx); ctarget.target = target.Clone (clonectx); }
protected override void CloneTo (CloneContext clonectx, Statement t) { Catch target = (Catch) t; if (type_expr != null) target.type_expr = (FullNamedExpression) type_expr.Clone (clonectx); target.block = clonectx.LookupBlock (block); }
protected override void CloneTo (CloneContext clonectx, Expression target) { throw new NotSupportedException ("should not be reached"); }
protected override void CloneTo (CloneContext clonectx, Statement t) { TryFinally target = (TryFinally) t; target.stmt = (Statement) stmt.Clone (clonectx); if (fini != null) target.fini = clonectx.LookupBlock (fini); }
protected override void CloneTo(CloneContext clonectx, Statement target) { }
protected override void CloneTo (CloneContext clonectx, Statement t) { TryCatch target = (TryCatch) t; target.Block = clonectx.LookupBlock (Block); if (General != null) target.General = (Catch) General.Clone (clonectx); if (Specific != null){ target.Specific = new List<Catch> (); foreach (Catch c in Specific) target.Specific.Add ((Catch) c.Clone (clonectx)); } }
public Argument Clone (CloneContext clonectx) { return Clone (Expr.Clone (clonectx)); }
protected override void CloneTo (CloneContext clonectx, Statement t) { Using target = (Using) t; target.decl = (VariableDeclaration) decl.Clone (clonectx); target.stmt = stmt.Clone (clonectx); }
protected override void CloneTo (CloneContext clonectx, Expression target) { // CloneTo: Nothing, we do not keep any state on this expression }
protected override void CloneTo (CloneContext clonectx, Statement t) { Foreach target = (Foreach) t; target.type = type.Clone (clonectx); target.expr = expr.Clone (clonectx); target.statement = statement.Clone (clonectx); }
public Arguments Clone (CloneContext ctx) { Arguments cloned = new Arguments (args.Count); foreach (Argument a in args) cloned.Add (a.Clone (ctx)); return cloned; }
protected override void CloneTo (CloneContext clonectx, Statement t) { For target = (For) t; if (InitStatement != null) target.InitStatement = InitStatement.Clone (clonectx); if (Test != null) target.Test = Test.Clone (clonectx); if (Increment != null) target.Increment = Increment.Clone (clonectx); target.Statement = Statement.Clone (clonectx); }
protected override void CloneTo(CloneContext clonectx, Statement target) { IteratorStatement t = (IteratorStatement) target; t.original_block = (ExplicitBlock) original_block.Clone (clonectx); t.iterator = (Iterator) iterator.Clone (clonectx); }
protected override void CloneTo (CloneContext clonectx, Statement t) { StatementExpression target = (StatementExpression) t; target.expr = (ExpressionStatement) expr.Clone (clonectx); }
protected override void CloneTo (CloneContext clonectx, Expression t) { CompletionMemberAccess target = (CompletionMemberAccess) t; if (targs != null) target.targs = targs.Clone (); target.expr = expr.Clone (clonectx); }
protected override void CloneTo (CloneContext clonectx, Statement target) { StatementList t = (StatementList) target; t.statements = new List<Statement> (statements.Count); foreach (Statement s in statements) t.statements.Add (s.Clone (clonectx)); }
protected override void CloneTo (CloneContext clonectx, Expression t) { Assign _target = (Assign) t; _target.target = target.Clone (clonectx); _target.source = source.Clone (clonectx); }
// // This routine must be overrided in derived classes and make copies // of all the data that might be modified if resolved // protected abstract void CloneTo (CloneContext clonectx, Statement target);
public sealed override Expression Clone (CloneContext clonectx) { // No cloning is not needed for constants return this; }
public Statement Clone (CloneContext clonectx) { Statement s = (Statement) this.MemberwiseClone (); CloneTo (clonectx, s); return s; }
protected override void CloneTo (CloneContext clonectx, Expression target) { // TODO: nothing ?? }
protected override void CloneTo (CloneContext clonectx, Statement t) { Return target = (Return) t; // It's null for simple return; if (Expr != null) target.Expr = Expr.Clone (clonectx); }
protected override void CloneTo (CloneContext clonectx, Statement target) { // Nothing to clone }
protected override void CloneTo(CloneContext clonectx, Expression t) { // Nothing }