当前位置: 首页>>代码示例>>C#>>正文


C# BinaryExpressionSyntax.Update方法代码示例

本文整理汇总了C#中BinaryExpressionSyntax.Update方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryExpressionSyntax.Update方法的具体用法?C# BinaryExpressionSyntax.Update怎么用?C# BinaryExpressionSyntax.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryExpressionSyntax的用法示例。


在下文中一共展示了BinaryExpressionSyntax.Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitBinaryExpression

        protected override SyntaxNode VisitBinaryExpression(BinaryExpressionSyntax node)
        {
            var nameSyntax = FindIdentifierName (node.Left);
            if (nameSyntax == null)
                return base.VisitBinaryExpression (node);

            switch (node.Kind)
            {
                case SyntaxKind.AddAssignExpression:
                case SyntaxKind.OrAssignExpression:
                case SyntaxKind.SubtractAssignExpression:
                case SyntaxKind.MultiplyAssignExpression:
                case SyntaxKind.DivideAssignExpression:
                case SyntaxKind.ModuloAssignExpression:
                case SyntaxKind.RightShiftAssignExpression:
                case SyntaxKind.LeftShiftAssignExpression:
                case SyntaxKind.AndAssignExpression:
                case SyntaxKind.ExclusiveOrAssignExpression:
                    var token = Syntax.Token (GetComplexAssignOperator (node.Kind));

                    ExpressionSyntax expr = Syntax.ParseExpression (nameSyntax.PlainName + token + node.Right);

                    return node.Update (node.Left, AssignToken, GetLogExpression (nameSyntax.PlainName, expr));

                case SyntaxKind.AssignExpression:
                    return node.Update (node.Left, node.OperatorToken, GetLogExpression (nameSyntax.PlainName, node.Right));

                default:
                    return base.VisitBinaryExpression (node);
            }
        }
开发者ID:Auxon,项目名称:Instant,代码行数:31,代码来源:LoggingRewriter.cs

示例2: VisitBinaryExpression

		/// <summary>
		///   Normalizes the <paramref name="binaryExpression" />.
		/// </summary>
		public override SyntaxNode VisitBinaryExpression(BinaryExpressionSyntax binaryExpression)
		{
			if (!IsFormulaType(binaryExpression))
				return base.VisitBinaryExpression(binaryExpression);

			var left = ReplaceImplicitConversion(binaryExpression.Left);
			var right = ReplaceImplicitConversion(binaryExpression.Right);
			return binaryExpression.Update(left, binaryExpression.OperatorToken, right);
		}
开发者ID:isse-augsburg,项目名称:ssharp,代码行数:12,代码来源:FormulaNormalizer.cs

示例3: VisitBinaryExpression

		/// <summary>
		///     Normalizes the <paramref name="binaryExpression" />.
		/// </summary>
		public override SyntaxNode VisitBinaryExpression(BinaryExpressionSyntax binaryExpression)
		{
			var expressionType = DetermineType(binaryExpression);
			if (expressionType == ExpressionType.Other)
				return base.VisitBinaryExpression(binaryExpression);

			var left = ReplaceImplicitConversion(expressionType, binaryExpression.Left);
			var right = ReplaceImplicitConversion(expressionType, binaryExpression.Right);
			return binaryExpression.Update(left, binaryExpression.OperatorToken, right);
		}
开发者ID:cubeme,项目名称:safety-sharp,代码行数:13,代码来源:FormulaNormalizer.cs


注:本文中的BinaryExpressionSyntax.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。