예제 #1
0
        public override void Visit(ArithmeticOp op, Node n)
        {
            VisitScalarOpDefault(op, n);
            switch (op.OpType)
            {
            case OpType.Plus:
            case OpType.Minus:
            case OpType.Multiply:
            case OpType.Divide:
            case OpType.Modulo:
                AssertEqualTypes(n.Child0.Op.Type, n.Child1.Op.Type);
                AssertEqualTypes(n.Op.Type, n.Child0.Op.Type);
                AssertArity(n, 2);
                break;

            case OpType.UnaryMinus:
                AssertArity(n, 1);
                break;

            default:
                AssertUnexpectedOp(op);
                break;
            }
        }
예제 #2
0
 // <summary>
 // Copies an ArithmeticOp
 // </summary>
 // <param name="op"> The Op to Copy </param>
 // <param name="n"> The Node that references the Op </param>
 // <returns> A copy of the original Node that references a copy of the original Op </returns>
 public override Node Visit(ArithmeticOp op, Node n)
 {
     return(CopyDefault(m_destCmd.CreateArithmeticOp(op.OpType, op.Type), n));
 }
 public virtual void Visit(ArithmeticOp op, Node n)
 {
     this.VisitScalarOpDefault((ScalarOp)op, n);
 }
예제 #4
0
 /// <summary>
 ///     Visitor pattern method for ArithmeticOp
 /// </summary>
 /// <param name="op"> The ArithmeticOp being visited </param>
 /// <param name="n"> The Node that references the Op </param>
 public virtual void Visit(ArithmeticOp op, Node n)
 {
     VisitScalarOpDefault(op, n);
 }
예제 #5
0
 // <summary>
 // ArithmeticOp
 // </summary>
 public virtual TResultType Visit(ArithmeticOp op, Node n)
 {
     return(VisitScalarOpDefault(op, n));
 }