Пример #1
0
        public static ICSharpnequalityExpression operator !=(ExpressionBase left, CSharpIExpression right)
        {
            ICSharpInequalityExpression leftSide  = (ICSharpInequalityExpression)left.AffixTo(OperatorPrecedences.InequalityOperation);
            ICSharpRelationalExpression rightSide = (ICSharpRelationalExpression)right.AffixTo(OperatorPrecedences.RelationalOperation);

            return(new ICSharpnequalityExpression(leftSide, false, rightSide));
        }
Пример #2
0
 public static ExpressionBase operator &(ExpressionBase left, CSharpIExpression right)
 {
     if (tfOpCalls.Contains(left))
     {
         tfOpCalls.Remove(left);
         ICSharpLogicalAndExpression leftSide  = (ICSharpLogicalAndExpression)left.AffixTo(OperatorPrecedences.LogicalAndOperation);
         ICSharpBitwiseOrExpression  rightSide = (ICSharpBitwiseOrExpression)right.AffixTo(OperatorPrecedences.BitwiseOrOperation);
         return(new CSharpLogicalAndExpression(leftSide, rightSide));
     }
     else
     {
         ICSharpBitwiseAndExpression leftSide  = (ICSharpBitwiseAndExpression)left.AffixTo(OperatorPrecedences.BitwiseAndOperation);
         ICSharpInequalityExpression rightSide = (ICSharpInequalityExpression)right.AffixTo(OperatorPrecedences.InequalityOperation);
         return(new CSharpBitwiseAndExpression(leftSide, rightSide));
     }
 }
Пример #3
0
        /// <summary><para>Creates a C&#9839; compiler warning, relative to the
        /// abstract model, (level 2) &#35;253:
        /// </para><para>Possible unintended reference comparison; to get
        /// a value comparison, cast the right hand side to type {0}</para></summary>
        public static ICompilerSourceModelWarning <ICSharpInequalityExpression> WarningCS0253(ICSharpInequalityExpression inequalityExpression)
        {
            var start = inequalityExpression.Start ?? LineColumnPair.Zero;
            var end   = inequalityExpression.End ?? LineColumnPair.Zero;

            return(new CompilerSourceModelWarning <ICSharpInequalityExpression>(CS0253, inequalityExpression, inequalityExpression.Location, start, end, inequalityExpression.ToString()));
        }