• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AssignmentExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AssignmentExpression的典型用法代码示例。如果您正苦于以下问题:C# AssignmentExpression类的具体用法?C# AssignmentExpression怎么用?C# AssignmentExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AssignmentExpression类属于命名空间,在下文中一共展示了AssignmentExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetActions

        public IEnumerable<CodeAction> GetActions(RefactoringContext context)
        {
            if (context.IsSomethingSelected) {
                yield break;
            }
            AstType type;
            var varDecl = GetVariableDeclarationStatement(context, out type);
            if (varDecl == null) {
                yield break;
            }
            yield return new CodeAction(context.TranslateString("Split local variable declaration and assignment"), script => {
                var assign = new AssignmentExpression (new IdentifierExpression (varDecl.Variables.First().Name), AssignmentOperatorType.Assign, varDecl.Variables.First().Initializer.Clone());

                var newVarDecl = (VariableDeclarationStatement)varDecl.Clone();
                newVarDecl.Role = BlockStatement.StatementRole;

                if (newVarDecl.Type.IsMatch(new SimpleType ("var"))) {
                    newVarDecl.Type = type;
                }

                newVarDecl.Variables.First().Initializer = Expression.Null;

                script.InsertBefore(varDecl, newVarDecl);
                script.Replace(varDecl, varDecl.Parent is ForStatement ? (AstNode)assign : new ExpressionStatement (assign));
            }, varDecl.Variables.First ().AssignToken);
        }
开发者ID:CSRedRat,项目名称:NRefactory,代码行数:26,代码来源:SplitDeclarationAndAssignmentAction.cs


示例2: VisitAssignmentExpression

        public override void VisitAssignmentExpression(AssignmentExpression expression)
        {
            base.VisitAssignmentExpression (expression);

            Identifier identifier = expression.FindIdentifier();
            if (identifier == null)
                return;

            switch (expression.Operator)
            {
                case AssignmentOperatorType.BitwiseOr:
                case AssignmentOperatorType.BitwiseAnd:
                case AssignmentOperatorType.ExclusiveOr:
                case AssignmentOperatorType.Add:
                case AssignmentOperatorType.Subtract:
                case AssignmentOperatorType.Divide:
                case AssignmentOperatorType.Modulus:
                case AssignmentOperatorType.Multiply:
                case AssignmentOperatorType.ShiftLeft:
                case AssignmentOperatorType.ShiftRight:
                case AssignmentOperatorType.Assign:
                    this.lineMap[this.id++] = expression.StartLocation.Line;
                    break;
            }
        }
开发者ID:ermau,项目名称:Instant,代码行数:25,代码来源:IdentifyingVisitor.cs


示例3: GetActions

		public override IEnumerable<CodeAction> GetActions(RefactoringContext context)
		{
			if (context.IsSomethingSelected) {
				yield break;
			}
			AstType type;
			var varInitializer = GetVariableDeclarationStatement(context, out type);
			if (varInitializer == null)
				yield break;
			var statement = varInitializer.GetParent<Statement>();
			var declaration = varInitializer.GetParent<VariableDeclarationStatement>();
			if (declaration == null || (declaration.Modifiers & Modifiers.Const) != 0)
				yield break;

			var selectedNode = varInitializer.GetNodeAt(context.Location) ?? varInitializer;

			yield return new CodeAction(context.TranslateString("Split local variable declaration and assignment"), script => {
				var assign = new AssignmentExpression (new IdentifierExpression (varInitializer.Name), AssignmentOperatorType.Assign, varInitializer.Initializer.Clone());

				if (declaration != null && declaration.Type.IsVar())
					script.Replace(declaration.Type, type);
				if (declaration.Parent is ForStatement) {
					script.InsertBefore(statement, new VariableDeclarationStatement (type, varInitializer.Name));
					script.Replace(declaration, assign);
				} else {
					script.Replace(varInitializer, new IdentifierExpression (varInitializer.Name));
					script.InsertAfter(statement, new ExpressionStatement (assign));
				}

			}, selectedNode);
		}
开发者ID:sphynx79,项目名称:dotfiles,代码行数:31,代码来源:SplitDeclarationAndAssignmentAction.cs


示例4: VisitAssignmentExpression

        public override void VisitAssignmentExpression(AssignmentExpression expression)
        {
            base.VisitAssignmentExpression (expression);

            Identifier identifier = expression.FindIdentifier();
            if (identifier == null)
                return;

            switch (expression.Operator)
            {
                case AssignmentOperatorType.BitwiseOr:
                case AssignmentOperatorType.BitwiseAnd:
                case AssignmentOperatorType.ExclusiveOr:
                case AssignmentOperatorType.Add:
                case AssignmentOperatorType.Subtract:
                case AssignmentOperatorType.Divide:
                case AssignmentOperatorType.Modulus:
                case AssignmentOperatorType.Multiply:
                case AssignmentOperatorType.ShiftLeft:
                case AssignmentOperatorType.ShiftRight:
                {
                    BinaryOperatorType op = GetComplexAssignOperator (expression.Operator);
                    Expression right = new BinaryOperatorExpression (new IdentifierExpression (identifier.Name), op, expression.Right.Clone());

                    expression.Operator = AssignmentOperatorType.Assign;
                    expression.Right = GetAssignmentExpression (identifier, right);

                    break;
                }

                case AssignmentOperatorType.Assign:
                    expression.Right = GetAssignmentExpression (identifier, expression.Right);
                    break;
            }
        }
开发者ID:ermau,项目名称:Instant,代码行数:35,代码来源:InstrumentingRewriter.cs


示例5: VisitAssignmentExpression

		public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data) {
			Debug.Assert((assignmentExpression != null));
			Debug.Assert((assignmentExpression.Left != null));
			Debug.Assert((assignmentExpression.Right != null));
			assignmentExpression.Left.AcceptVisitor(this, data);
			return assignmentExpression.Right.AcceptVisitor(this, data);
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:7,代码来源:AbstractASTVisitor.cs


示例6: Visit

        public override void Visit(AssignmentExpression expression)
        {
            outStream.Write(printFuncName + "(");
            expression.Left.Accept(this);            

            switch (expression.AssignmentOperator)
            {
                case AssignmentOperator.Add: outStream.Write(" += "); break;
                case AssignmentOperator.And: outStream.Write(" &= "); break;
                case AssignmentOperator.Assign: outStream.Write(" = "); break;
                case AssignmentOperator.Divide: outStream.Write(" /= "); break;
                case AssignmentOperator.Modulo: outStream.Write(" %= "); break;
                case AssignmentOperator.Multiply: outStream.Write(" *= "); break;
                case AssignmentOperator.Or: outStream.Write(" |= "); break;
                case AssignmentOperator.ShiftLeft: outStream.Write(" <<= "); break;
                case AssignmentOperator.ShiftRight: outStream.Write(" >>= "); break;
                case AssignmentOperator.Substract: outStream.Write(" -= "); break;
                case AssignmentOperator.UnsignedRightShift: outStream.Write(" >>>= "); break;
                case AssignmentOperator.XOr: outStream.Write(" ^= "); break;
            }

            expression.Right.Accept(this);
            outStream.Write(", \"{0}\")", TempName);

            //int currentTempCounter = tempCounter++;
            //outStream.Write("{0}{1} = ", tempVarName, currentTempCounter);
            //expression.Right.Accept(this);
            //outStream.WriteLine(";");

            //outStream.WriteLine("{0}{1};\nprint({0}{1});", tempVarName, currentTempCounter, tempVarName, currentTempCounter);            
        }
开发者ID:reshadi2,项目名称:mcjs,代码行数:31,代码来源:JSIntrumentor.cs


示例7: VisitAssignmentExpression

			public override void VisitAssignmentExpression (AssignmentExpression assignmentExpression)
			{
				base.VisitAssignmentExpression (assignmentExpression);

				if (assignmentExpression.Operator != AssignmentOperatorType.Assign)
					return;
				if (!(assignmentExpression.Left is IdentifierExpression) && 
					!(assignmentExpression.Left is MemberReferenceExpression))
					return;

				var resolveResult = ctx.Resolve (assignmentExpression.Left);
				var memberResolveResult = resolveResult as MemberResolveResult;
				if (memberResolveResult != null) {
					var memberResolveResult2 = ctx.Resolve (assignmentExpression.Right) as MemberResolveResult;
					if (memberResolveResult2 == null || !AreEquivalent(memberResolveResult, memberResolveResult2))
						return;
				} else if (resolveResult is LocalResolveResult) {
					if (!assignmentExpression.Left.Match (assignmentExpression.Right).Success)
						return;
				} else {
					return;
				}

				AstNode node;
				Action<Script> action;
				if (assignmentExpression.Parent is ExpressionStatement) {
					node = assignmentExpression.Parent;
					action = script => script.Remove (assignmentExpression.Parent);
				} else {
					node = assignmentExpression;
					action = script => script.Replace (assignmentExpression, assignmentExpression.Left.Clone ());
				}
				AddIssue (node, ctx.TranslateString ("CS1717:Assignment made to same variable"),
					new [] { new CodeAction (ctx.TranslateString ("Remove assignment"), action) });
			}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:35,代码来源:AssignmentMadeToSameVariableIssue.cs


示例8: GetNewEqualityTestCode

		private static string GetNewEqualityTestCode(AssignmentExpression assignmentExpression)
		{
			RelationalOperation relationalOperation = new RelationalOperation(assignmentExpression.LeftSide.Clone() as Expression,
																												RelationalOperator.Equality,
																												assignmentExpression.RightSide.Clone() as Expression);
			string newEqualityTest = CodeRush.Language.GenerateElement(relationalOperation);
			return newEqualityTest;
		}
开发者ID:kevinmiles,项目名称:dxcorecommunityplugins,代码行数:8,代码来源:PlugIn1.cs


示例9: ArgumentsInfo

        public ArgumentsInfo(IEmitter emitter, AssignmentExpression assignmentExpression, OperatorResolveResult operatorResolveResult, IMethod method)
        {
            this.Emitter = emitter;
            this.Expression = assignmentExpression;
            this.OperatorResolveResult = operatorResolveResult;

            this.BuildOperatorArgumentsList(new Expression[] { assignmentExpression.Left, assignmentExpression.Right }, operatorResolveResult.UserDefinedOperatorMethod ?? method);
            this.BuildOperatorTypedArguments();
        }
开发者ID:RashmiPankaj,项目名称:Bridge,代码行数:9,代码来源:ArgumentsInfo.cs


示例10: VisitAssignmentExpression

 public override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)
 {
     // assignment is right-associative
     ParenthesizeIfRequired(assignmentExpression.Left, Assignment + 1);
     if (InsertParenthesesForReadability) {
         ParenthesizeIfRequired(assignmentExpression.Right, RelationalAndTypeTesting + 1);
     } else {
         ParenthesizeIfRequired(assignmentExpression.Right, Assignment);
     }
     base.VisitAssignmentExpression(assignmentExpression);
 }
开发者ID:artifexor,项目名称:NRefactory,代码行数:11,代码来源:InsertParenthesesVisitor.cs


示例11: VisitAssignmentExpression

            public override object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
            {
                var ns = assignmentExpression.GetCurrentNamespace();
                var variable = assignmentExpression.Left.GetIdentifier();
                var fullVariableName = ns + "." + variable;

                if(_codebaseDeclarations.Any(a => a.FullName == fullVariableName && a.DeclarationClassType == TypeDeclarationKind.Event) && assignmentExpression.Operator == AssignmentOperatorType.Add)
                {
                    UnlockWith(assignmentExpression);
                }

                return base.VisitAssignmentExpression(assignmentExpression, data);
            }
开发者ID:jonasswiatek,项目名称:strokes,代码行数:13,代码来源:SubscribeToEventAchievement.cs


示例12: VisitAssignmentExpression

 public override Expression VisitAssignmentExpression(AssignmentExpression assign) {
   AssignmentStatement stat = assign.AssignmentStatement as AssignmentStatement;
   if (stat != null) {
     stat.Target = this.VisitExpression(stat.Target);
     stat.Source = this.VisitExpression(stat.Source);
   }
   this.composers.Clear();
   if (stat != null) {
     this.composers.Add(this.GetComposer(stat.Target));
     this.composers.Add(this.GetComposer(stat.Source));
   }
   return (Expression) this.Compose(assign, this.composers);
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:13,代码来源:Partitioner.cs


示例13: EqualityInAssignment

		public void EqualityInAssignment()
		{
			Expression expr = new AssignmentExpression(
				new IdentifierExpression("cond"),
				new BinaryOperatorExpression(
					new IdentifierExpression("a"),
					BinaryOperatorType.Equality,
					new IdentifierExpression("b")
				)
			);
			
			Assert.AreEqual("cond = a == b", InsertRequired(expr));
			Assert.AreEqual("cond = (a == b)", InsertReadable(expr));
		}
开发者ID:qjlee,项目名称:ILSpy,代码行数:14,代码来源:InsertParenthesesVisitorTests.cs


示例14: VisitAssignmentExpression

            public override object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
            {
                if (assignmentExpression.Right is PrimitiveExpression)
                {
                    PrimitiveExpression prim = (PrimitiveExpression)assignmentExpression.Right;

                    int number;
                    if (int.TryParse(prim.LiteralValue, out number))
                    {
                        if (number == 666)
                            UnlockWith(assignmentExpression);
                    }
                }
                return base.VisitAssignmentExpression(assignmentExpression, data);
            }
开发者ID:vlad2135,项目名称:strokes,代码行数:15,代码来源:BeastNumberAchievement.cs


示例15: ConvertToInitializer

		public AssignmentExpression ConvertToInitializer(AssignmentExpression assignmentExpression, ref IList<AstNode> statements)
		{
			if (assignmentExpression == null)
				throw new ArgumentNullException("assignmentExpression");
			if (statements == null)
				throw new ArgumentNullException("statements");
			if (!(assignmentExpression.Right is ObjectCreateExpression))
				throw new ArgumentException("assignmentExpression.Right must be an ObjectCreateExpression", "assignmentExpression");

			Initialize(assignmentExpression.Left);
			accessPaths [mainAccessPath] = assignmentExpression.Right.Clone();

			Convert(statements);
			statements = ReplacementNodeHelper.GetReplacedNodes(accessPaths [mainAccessPath]);
			return new AssignmentExpression(new IdentifierExpression(mainAccessPath.RootName), accessPaths [mainAccessPath]);
		}
开发者ID:FloodProject,项目名称:ICSharpCode.NRefactory,代码行数:16,代码来源:StatementsToInitializerConverter.cs


示例16: Run

		public void Run (RefactoringContext context)
		{
			AstType type;
			var varDecl = GetVariableDeclarationStatement (context, out type);
			
			var assign = new AssignmentExpression (new IdentifierExpression (varDecl.Variables.First ().Name), AssignmentOperatorType.Assign, varDecl.Variables.First ().Initializer.Clone ());
			
			var newVarDecl = (VariableDeclarationStatement)varDecl.Clone ();
			
			if (newVarDecl.Type.IsMatch (new SimpleType ("var")))
				newVarDecl.Type = type;
			
			newVarDecl.Variables.First ().Initializer = Expression.Null;
			
			using (var script = context.StartScript ()) {
				script.InsertBefore (varDecl, newVarDecl);
				script.Replace (varDecl, varDecl.Parent is ForStatement ? (AstNode)assign : new ExpressionStatement (assign));
			}
		}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:19,代码来源:SplitDeclarationAndAssignment.cs


示例17: GetActions

		public IEnumerable<CodeAction> GetActions(RefactoringContext context)
		{
			//TODO: implement variable assignment & ctor param
			var varInit = context.GetNode<VariableInitializer>();
			if (varInit != null) {
				AstType type = varInit.GetPrevNode() as AstType;
				if (type == null) yield break;
				if (varInit.Parent is FieldDeclaration) yield break;
				if (CannotExtractField(varInit)) yield break;
				
				yield return new CodeAction("Extract field", s=>{
					var name = varInit.Name;
					FieldDeclaration field = new FieldDeclaration(){
						ReturnType = type.Clone(),
						Variables = { new VariableInitializer(name) }
					};
					AstNode nodeToRemove = RemoveDeclaration(varInit) ? varInit.Parent : type;
					s.Remove(nodeToRemove, true);
					s.InsertWithCursor(context.TranslateString("Extract field"),Script.InsertPosition.Before,field);
					s.FormatText(varInit.Parent);
				});
			}
			
			var idntf = context.GetNode<Identifier>();
			if (idntf == null) yield break;
			var paramDec = idntf.Parent as ParameterDeclaration;
			if (paramDec != null) {
				var ctor = paramDec.Parent as ConstructorDeclaration;
				if (ctor == null) yield break;
				MemberReferenceExpression thisField = new MemberReferenceExpression(new ThisReferenceExpression(), idntf.Name, new AstType[]{});
				var assign = new AssignmentExpression(thisField, AssignmentOperatorType.Assign, new IdentifierExpression(idntf.Name));
				var statement = new ExpressionStatement(assign);
				var type = (idntf.GetPrevNode() as AstType).Clone();
				FieldDeclaration field = new FieldDeclaration(){
					ReturnType = type.Clone(),
					Variables = { new VariableInitializer(idntf.Name) }
				};
				yield return new CodeAction("Extract field", s=>{
					s.InsertWithCursor(context.TranslateString("Extract field"),Script.InsertPosition.Before,field);
					s.AddTo(ctor.Body, statement);
				});
			}
		}
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:43,代码来源:ExtractFieldAction.cs


示例18: CreateFromStatements


//.........这里部分代码省略.........
				var lastStatement = statements [statements.Count - 1];
				
				var stmt = statements [0].GetParent<BlockStatement>();
				while (stmt.GetParent<BlockStatement> () != null) {
					stmt = stmt.GetParent<BlockStatement>();
				}
				
				inExtractedRegion.SetAnalyzedRange(statements [0], lastStatement);
				stmt.AcceptVisitor (inExtractedRegion);
				
				var beforeExtractedRegion = new VariableUsageAnalyzation (context, usedVariables);
				beforeExtractedRegion.SetAnalyzedRange(statements [0].Parent, statements [0], true, false);
				stmt.AcceptVisitor (beforeExtractedRegion);
				
				var afterExtractedRegion = new VariableUsageAnalyzation (context, usedVariables);
				afterExtractedRegion.SetAnalyzedRange(lastStatement, stmt.Statements.Last(), false, true);
				stmt.AcceptVisitor (afterExtractedRegion);
				usedVariables.Sort ((l, r) => l.Region.Begin.CompareTo (r.Region.Begin));

				IVariable generatedReturnVariable = null;
				foreach (var variable in usedVariables) {
					if ((variable is IParameter) || beforeExtractedRegion.Has (variable) || !afterExtractedRegion.Has (variable))
						continue;
					generatedReturnVariable = variable;
					method.ReturnType = context.CreateShortType (variable.Type);
					method.Body.Add (new ReturnStatement (new IdentifierExpression (variable.Name)));
					break;
				}

				int parameterOutCount = 0;
				foreach (var variable in usedVariables) {
					if (!(variable is IParameter) && !beforeExtractedRegion.Has (variable) && !afterExtractedRegion.Has (variable))
						continue;
					if (variable == generatedReturnVariable)
						continue;
					Expression argumentExpression = new IdentifierExpression(variable.Name); 
					
					ParameterModifier mod = ParameterModifier.None;
					if (inExtractedRegion.GetStatus (variable) == VariableState.Changed) {
						if (beforeExtractedRegion.GetStatus (variable) == VariableState.None) {
							mod = ParameterModifier.Out;
							argumentExpression = new DirectionExpression(FieldDirection.Out, argumentExpression);
							parameterOutCount++;
						} else {
							mod = ParameterModifier.Ref;
							argumentExpression = new DirectionExpression(FieldDirection.Ref, argumentExpression);
						}
					}
					
					method.Parameters.Add(new ParameterDeclaration(context.CreateShortType(variable.Type), variable.Name, mod));
					invocation.Arguments.Add(argumentExpression);
				}

				ParameterDeclaration parameterToTransform = null;
				bool transformParameterToReturn = method.ReturnType is PrimitiveType && 
				                                  ((PrimitiveType)method.ReturnType).Keyword == "void" &&
				                                  parameterOutCount == 1;
				if(transformParameterToReturn) {
					parameterToTransform = method.Parameters.First(p => p.ParameterModifier == ParameterModifier.Out);
					parameterToTransform.Remove();
					var argumentExpression = invocation.Arguments.OfType<DirectionExpression>().First(a => a.FieldDirection == FieldDirection.Out);
					argumentExpression.Remove();
					method.ReturnType = parameterToTransform.Type.Clone();
					var argumentDecl = new VariableDeclarationStatement(parameterToTransform.Type.Clone(),parameterToTransform.Name);
					method.Body.InsertChildBefore(method.Body.First(),argumentDecl,BlockStatement.StatementRole);
					method.Body.Add(new ReturnStatement (new IdentifierExpression (parameterToTransform.Name)));
				}

				script
					.InsertWithCursor(context.TranslateString("Extract method"), Script.InsertPosition.Before, method)
					.ContinueScript(delegate {
						foreach (var node in statements.Skip (1)) {
							if (node is NewLineNode)
								continue;
							script.Remove(node);
						}
						foreach (var variable in usedVariables) {
							if ((variable is IParameter) || beforeExtractedRegion.Has (variable) || !afterExtractedRegion.Has (variable))
								continue;
							if (variable == generatedReturnVariable)
								continue;
							script.InsertBefore (statements [0], new VariableDeclarationStatement (context.CreateShortType(variable.Type), variable.Name));
						}
						Statement invocationStatement;

						if (generatedReturnVariable != null) {
							invocationStatement = new VariableDeclarationStatement (new SimpleType ("var"), generatedReturnVariable.Name, invocation);
						} else if(transformParameterToReturn) {
							invocationStatement = new AssignmentExpression(new IdentifierExpression(parameterToTransform.Name), invocation);
						} else {
							invocationStatement = invocation;
						}

						script.Replace(statements [0], invocationStatement);


						script.Link(target, method.NameToken);
					});
			}, statements.First ().StartLocation, statements.Last ().EndLocation);
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:101,代码来源:ExtractMethodAction.cs


示例19: Visit

			public override object Visit(CompoundAssign compoundAssign)
			{
				var result = new AssignmentExpression();
				switch (compoundAssign.Op) {
					case Binary.Operator.Multiply:
						result.Operator = AssignmentOperatorType.Multiply;
						break;
					case Binary.Operator.Division:
						result.Operator = AssignmentOperatorType.Divide;
						break;
					case Binary.Operator.Modulus:
						result.Operator = AssignmentOperatorType.Modulus;
						break;
					case Binary.Operator.Addition:
						result.Operator = AssignmentOperatorType.Add;
						break;
					case Binary.Operator.Subtraction:
						result.Operator = AssignmentOperatorType.Subtract;
						break;
					case Binary.Operator.LeftShift:
						result.Operator = AssignmentOperatorType.ShiftLeft;
						break;
					case Binary.Operator.RightShift:
						result.Operator = AssignmentOperatorType.ShiftRight;
						break;
					case Binary.Operator.BitwiseAnd:
						result.Operator = AssignmentOperatorType.BitwiseAnd;
						break;
					case Binary.Operator.BitwiseOr:
						result.Operator = AssignmentOperatorType.BitwiseOr;
						break;
					case Binary.Operator.ExclusiveOr:
						result.Operator = AssignmentOperatorType.ExclusiveOr;
						break;
				}
				
				if (compoundAssign.Target != null)
					result.AddChild((Expression)compoundAssign.Target.Accept(this), AssignmentExpression.LeftRole);
				var location = LocationsBag.GetLocations(compoundAssign);
				if (location != null) {
					var r = AssignmentExpression.GetOperatorRole(result.Operator);
					result.AddChild(new CSharpTokenNode(Convert(location [0]), r), r);
				}
				if (compoundAssign.Source != null)
					result.AddChild((Expression)compoundAssign.Source.Accept(this), AssignmentExpression.RightRole);
				return result;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:47,代码来源:CSharpParser.cs


示例20: VisitAssignmentExpression

 public virtual Expression VisitAssignmentExpression(AssignmentExpression assignment, AssignmentExpression changes, AssignmentExpression deletions, AssignmentExpression insertions){
   this.UpdateSourceContext(assignment, changes);
   if (assignment == null) return changes;
   if (changes != null){
     if (deletions == null || insertions == null)
       Debug.Assert(false);
     else{
       assignment.AssignmentStatement = this.VisitAssignmentStatement(assignment.AssignmentStatement as AssignmentStatement, changes.AssignmentStatement as AssignmentStatement, deletions.AssignmentStatement as AssignmentStatement, insertions.AssignmentStatement as AssignmentStatement);
     }
   }else if (deletions != null)
     return null;
   return assignment;
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:13,代码来源:Updater.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AssignmentExpressionSyntax类代码示例发布时间:2022-05-24
下一篇:
C# Assignment类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap