public void Insert(LPOperator op) { op.Parent = this; op.Function = Function; op.Module = Module; Childs.Add(op); }
public void InsertAfter(LPOperator op) { op.Parent = Parent; op.Function = Function; op.Module = Module; var pos = Parent.Position(this); Parent.Childs.Insert(pos + 1, op); }
/// <summary> /// Unlink from current basic-bloc and insert after this operator. /// </summary> /// <param name="op"></param> public void MoveAfter(LPOperator op) { var pos = op.Parent.Position(op); if (pos < 0) { throw new LPOperatorNotFoundException(op); } RemoveFromParent(); op.InsertAfter(this); }
public LPOperatorNotFoundException(LPOperator op) { Operator = op; }
public int Position(LPOperator op) => Childs.IndexOf(op);