void AddIssue(AstNode invocationExpression, Match match, bool negate = false)
 {
     AddIssue(new CodeIssue(
                  invocationExpression,
                  ctx.TranslateString("Use 'is' operator"),
                  ctx.TranslateString("Replace with 'is' operator"),
                  s => {
         Expression expression = new IsExpression(AlUtil.AddParensForUnaryExpressionIfRequired(match.Get <Expression>("object").Single().Clone()), match.Get <AstType>("Type").Single().Clone());
         if (negate)
         {
             expression = new UnaryOperatorExpression(UnaryOperatorType.Not, new ParenthesizedExpression(expression));
         }
         s.Replace(invocationExpression, expression);
     }
                  ));
 }
        Expression Add(Expression expr, Expression step)
        {
            var pe = expr as PrimitiveExpression;

            if (pe != null)
            {
                if (step == null)
                {
                    return(new PrimitiveExpression((int)pe.Value + 1));
                }
                var stepExpr = step as PrimitiveExpression;
                if (stepExpr != null)
                {
                    return(new PrimitiveExpression((int)pe.Value + (int)stepExpr.Value));
                }
            }

            var bOp = expr as BinaryOperatorExpression;

            if (bOp != null)
            {
                if (bOp.Operator == BinaryOperatorType.Add)
                {
                    var right = Add(bOp.Right, step);
                    if (zeroExpr.IsMatch(right))
                    {
                        return(bOp.Left.Clone());
                    }
                    return(new BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.Add, right));
                }
                if (bOp.Operator == BinaryOperatorType.Subtract)
                {
                    var right = Subtract(bOp.Right, step);
                    if (zeroExpr.IsMatch(right))
                    {
                        return(bOp.Left.Clone());
                    }
                    return(new BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.Subtract, right));
                }
            }
            if (step == null)
            {
                return(new BinaryOperatorExpression(expr.Clone(), BinaryOperatorType.Add, new PrimitiveExpression(1)));
            }

            return(new BinaryOperatorExpression(expr.Clone(), BinaryOperatorType.Add, AlUtil.AddParensForUnaryExpressionIfRequired(step.Clone())));
        }