internal Opcode Add(object item, Opcode ops) { List <SubExpr> list = new List <SubExpr>(); this.removalMapping.Add(item, list); while (ops.Next != null) { ops = ops.Next; } Opcode opcode = ops; while (ops != null) { if (IsExprStarter(ops)) { SubExprOpcode opcode4; Opcode op = ops; Opcode prev = ops.Prev; ops.DetachFromParent(); ops = ops.Next; while (ops.ID == OpcodeID.Select) { ops = ops.Next; } ops.DetachFromParent(); SubExpr expr = null; for (int i = 0; i < this.exprList.Count; i++) { if (this.exprList[i].FirstOp.Equals(op)) { expr = this.exprList[i]; break; } } if (expr == null) { expr = new SubExpr(null, op, this.NewVarID()); this.exprList.Add(expr); opcode4 = new SubExprOpcode(expr); } else { opcode4 = expr.Add(op, this); } opcode4.Expr.IncRef(); list.Add(opcode4.Expr); opcode4.Attach(ops); ops = opcode4; if (prev != null) { prev.Attach(ops); } } opcode = ops; ops = ops.Prev; } return(opcode); }
internal Opcode Add(object item, Opcode ops) { List<SubExpr> list = new List<SubExpr>(); this.removalMapping.Add(item, list); while (ops.Next != null) { ops = ops.Next; } Opcode opcode = ops; while (ops != null) { if (IsExprStarter(ops)) { SubExprOpcode opcode4; Opcode op = ops; Opcode prev = ops.Prev; ops.DetachFromParent(); ops = ops.Next; while (ops.ID == OpcodeID.Select) { ops = ops.Next; } ops.DetachFromParent(); SubExpr expr = null; for (int i = 0; i < this.exprList.Count; i++) { if (this.exprList[i].FirstOp.Equals(op)) { expr = this.exprList[i]; break; } } if (expr == null) { expr = new SubExpr(null, op, this.NewVarID()); this.exprList.Add(expr); opcode4 = new SubExprOpcode(expr); } else { opcode4 = expr.Add(op, this); } opcode4.Expr.IncRef(); list.Add(opcode4.Expr); opcode4.Attach(ops); ops = opcode4; if (prev != null) { prev.Attach(ops); } } opcode = ops; ops = ops.Prev; } return opcode; }
internal override bool Equals(Opcode op) { if (base.Equals(op)) { SubExprOpcode sop = op as SubExprOpcode; if (sop != null) { return(this.expr == sop.expr); } } return(false); }
internal Opcode Add(object item, Opcode ops) { List <SubExpr> exprs = new List <SubExpr>(); this.removalMapping.Add(item, exprs); while (ops.Next != null) { ops = ops.Next; } Opcode res = ops; while (ops != null) { if (IsExprStarter(ops)) { Opcode start = ops; Opcode p = ops.Prev; ops.DetachFromParent(); ops = ops.Next; while (ops.ID == OpcodeID.Select) { ops = ops.Next; } ops.DetachFromParent(); SubExpr e = null; for (int i = 0; i < this.exprList.Count; ++i) { if (this.exprList[i].FirstOp.Equals(start)) { e = this.exprList[i]; break; } } SubExprOpcode o; if (e == null) { e = new SubExpr(null, start, NewVarID()); this.exprList.Add(e); o = new SubExprOpcode(e); } else { o = e.Add(start, this); } o.Expr.IncRef(); exprs.Add(o.Expr); o.Attach(ops); ops = o; if (p != null) { p.Attach(ops); } } res = ops; ops = ops.Prev; } return(res); }
internal Opcode Add(object item, Opcode ops) { List<SubExpr> exprs = new List<SubExpr>(); this.removalMapping.Add(item, exprs); while (ops.Next != null) { ops = ops.Next; } Opcode res = ops; while (ops != null) { if (IsExprStarter(ops)) { Opcode start = ops; Opcode p = ops.Prev; ops.DetachFromParent(); ops = ops.Next; while (ops.ID == OpcodeID.Select) { ops = ops.Next; } ops.DetachFromParent(); SubExpr e = null; for (int i = 0; i < this.exprList.Count; ++i) { if (this.exprList[i].FirstOp.Equals(start)) { e = this.exprList[i]; break; } } SubExprOpcode o; if (e == null) { e = new SubExpr(null, start, NewVarID()); this.exprList.Add(e); o = new SubExprOpcode(e); } else { o = e.Add(start, this); } o.Expr.IncRef(); exprs.Add(o.Expr); o.Attach(ops); ops = o; if (p != null) { p.Attach(ops); } } res = ops; ops = ops.Prev; } return res; }