Esempio n. 1
0
 public void Insert(LPOperator op)
 {
     op.Parent   = this;
     op.Function = Function;
     op.Module   = Module;
     Childs.Add(op);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
 public LPOperatorNotFoundException(LPOperator op)
 {
     Operator = op;
 }
Esempio n. 5
0
 public int Position(LPOperator op)
 => Childs.IndexOf(op);