Beispiel #1
0
        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="leftHandSide">Left variable</param>
        /// <param name="rightHandSide">Right variable</param>
        public Add(object leftHandSide, object rightHandSide)
        {
            MethodBase method = MethodBase.CurrentMethod;
            var        left   = leftHandSide as VariableBase;
            var        right  = rightHandSide as VariableBase;

            if (left == null)
            {
                LeftHandSide = method.CreateConstant(leftHandSide);
            }
            else
            {
                LeftHandSide = left;
            }
            if (right == null)
            {
                RightHandSide = method.CreateConstant(rightHandSide);
            }
            else
            {
                RightHandSide = right;
            }
            Result =
                MethodBase.CurrentMethod.CreateLocal(
                    "AddLocalResult" + MethodBase.ObjectCounter.ToString(CultureInfo.InvariantCulture),
                    LeftHandSide.DataType);
        }