Example #1
0
        /// <summary>
        /// Returns an <see cref="CSharpAddSubtExpression"/> concatination of
        /// <paramref name="left"/> and <paramref name="right"/> with the
        /// <see cref="CSharpAddSubtExpression.Operation"/> set to
        /// <see cref="AddSubtOperation.Addition"/>.
        /// </summary>
        /// <param name="left">The <see cref="ExpressionBase"/> as the left-node of the
        /// <see cref="CSharpAddSubtExpression"/>.</param>
        /// <param name="right">The <see cref="CSharpIExpression"/> as the right-node of the
        /// <see cref="CSharpAddSubtExpression"/>.</param>
        /// <returns>An <see cref="CSharpAddSubtExpression"/> concatination of
        /// <paramref name="left"/> and <paramref name="right"/> with the
        /// <see cref="CSharpAddSubtExpression.Operation"/> set to
        /// <see cref="AddSubtOperation.Addition"/>.</returns>
        public static CSharpAddSubtExpression operator +(ExpressionBase left, CSharpIExpression right)
        {
            ICSharpAddSubtExpression leftSide  = (ICSharpAddSubtExpression)left.AffixTo(OperatorPrecedences.AddSubtOperation);
            ICSharpMulDivExpression  rightSide = (ICSharpMulDivExpression)right.AffixTo(OperatorPrecedences.CSharpMulDivOperation);

            return(new CSharpAddSubtExpression(leftSide, AddSubtOperation.Addition, rightSide));
        }
Example #2
0
        public static CSharpMulDivExpression operator %(ExpressionBase left, CSharpIExpression right)
        {
            ICSharpMulDivExpression   leftSide  = (ICSharpMulDivExpression)left.AffixTo(OperatorPrecedences.CSharpMulDivOperation);
            IUnaryOperationExpression rightSide = (IUnaryOperationExpression)right.AffixTo(OperatorPrecedences.UnaryOperation);

            return(new CSharpMulDivExpression(leftSide, CSharpMulDivOperation.Remainder, rightSide));
        }