Inheritance: ICSharpCode.NRefactory.Ast.Expression
Exemplo n.º 1
0
        public override object VisitDirectionExpression(ICSharpCode.NRefactory.Ast.DirectionExpression directionExpression, object data)
        {
            valueGetsChanged = true;
            IdentifierExpression left = directionExpression.Expression as IdentifierExpression;
            bool   isInitialUse       = left != null && !variables.ContainsKey(left.Identifier);
            object result             = base.VisitDirectionExpression(directionExpression, data);

            valueGetsChanged = false;
            if (left != null && variables.ContainsKey(left.Identifier))
            {
                variables[left.Identifier].GetsChanged = true;
                if (isInitialUse && directionExpression.FieldDirection == FieldDirection.Out)
                {
                    variables[left.Identifier].GetsAssigned = true;
                }
            }

            return(result);
        }
		static InvocationExpression CreateMethodCall(MethodDeclaration method)
		{
			IdentifierExpression wrappedObject = new IdentifierExpression("wrappedObject");
			MemberReferenceExpression methodName = new MemberReferenceExpression(wrappedObject, method.Name);
			InvocationExpression ie = new InvocationExpression(methodName, null);
			foreach (ParameterDeclarationExpression param in method.Parameters) {
				Expression expr = new IdentifierExpression(param.ParameterName);
				if (param.ParamModifier == ParameterModifiers.Ref) {
					expr = new DirectionExpression(FieldDirection.Ref, expr);
				}
				ie.Arguments.Add(expr);
			}
			return ie;
		}
Exemplo n.º 3
0
		public override object VisitDirectionExpression(DirectionExpression directionExpression, object data)
		{
			return CreateResolveResult(new ReferenceReturnType(ResolveType(directionExpression.Expression)));
		}
Exemplo n.º 4
0
	void Argument(
#line  1392 "Frames/cs.ATG" 
out Expression argumentexpr) {

#line  1394 "Frames/cs.ATG" 
		Expression expr;
		FieldDirection fd = FieldDirection.None;
		
		if (la.kind == 93 || la.kind == 100) {
			if (la.kind == 100) {
				lexer.NextToken();

#line  1399 "Frames/cs.ATG" 
				fd = FieldDirection.Ref; 
			} else {
				lexer.NextToken();

#line  1400 "Frames/cs.ATG" 
				fd = FieldDirection.Out; 
			}
		}
		Expr(
#line  1402 "Frames/cs.ATG" 
out expr);

#line  1403 "Frames/cs.ATG" 
		argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; 
	}
		public virtual object TrackedVisitDirectionExpression(DirectionExpression directionExpression, object data) {
			return base.VisitDirectionExpression(directionExpression, data);
		}
Exemplo n.º 6
0
 public override object VisitDirectionExpression (DirectionExpression directionExpression, object data)
 {
     directionExpression.Expression.AcceptChildren (this, null);
     Console.WriteLine ("Direction Expression, handle this...");
     return null;
 }
Exemplo n.º 7
0
 public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data)
 {
     Debug.Assert((directionExpression != null));
     Debug.Assert((directionExpression.Expression != null));
     return directionExpression.Expression.AcceptVisitor(this, data);
 }
Exemplo n.º 8
0
		public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data) {
			throw new global::System.NotImplementedException("DirectionExpression");
		}
 public virtual bool VisitDirectionExpression(DirectionExpression directionExpression, object d)
 {
     if ((directionExpression == null)) {
         return SetFailure();
     }
     if ((d == null)) {
         return SetFailure();
     }
     if ((directionExpression.Expression == null)) {
         return SetFailure();
     }
     if(directionExpression.GetType() != d.GetType()) {return SetFailure();}
     var data = (DirectionExpression)d;
     if (!IsMatch(directionExpression, data)) {
         return SetFailure();
     }
     return directionExpression.Expression.AcceptVisitor(this, data.Expression);
 }
 public object VisitDirectionExpression(DirectionExpression directionExpression, object data)
 {
     throw new NotImplementedException ();
 }
Exemplo n.º 11
0
		public override object VisitDirectionExpression(DirectionExpression directionExpression, object data)
		{
			return base.VisitDirectionExpression(directionExpression, data);
		}
 private bool IsMatch(DirectionExpression left, DirectionExpression right)
 {
     return left.FieldDirection == right.FieldDirection;
 }
Exemplo n.º 13
0
 public override object VisitDirectionExpression(DirectionExpression directionExpression, object data)
 {
     directionExpression.Expression.Parent = directionExpression;
     return base.VisitDirectionExpression(directionExpression, data);
 }
Exemplo n.º 14
0
	void ArgumentValue(
//#line  1396 "cs.ATG" 
out Expression argumentexpr) {

//#line  1398 "cs.ATG" 
		Expression expr;
		FieldDirection fd = FieldDirection.None;
		
		if (la.kind == 93 || la.kind == 100) {
			if (la.kind == 100) {
				lexer.NextToken();

//#line  1403 "cs.ATG" 
				fd = FieldDirection.Ref; 
			} else {
				lexer.NextToken();

//#line  1404 "cs.ATG" 
				fd = FieldDirection.Out; 
			}
		}
		Expr(
//#line  1406 "cs.ATG" 
out expr);

//#line  1407 "cs.ATG" 
		argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; 
	}
Exemplo n.º 15
0
	void Argument(
#line  1373 "cs.ATG" 
out Expression argumentexpr) {

#line  1375 "cs.ATG" 
		Expression expr;
		FieldDirection fd = FieldDirection.None;
		
		if (la.kind == 93 || la.kind == 100) {
			if (la.kind == 100) {
				lexer.NextToken();

#line  1380 "cs.ATG" 
				fd = FieldDirection.Ref; 
			} else {
				lexer.NextToken();

#line  1381 "cs.ATG" 
				fd = FieldDirection.Out; 
			}
		}
		Expr(
#line  1383 "cs.ATG" 
out expr);

#line  1384 "cs.ATG" 
		argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; 
	}
Exemplo n.º 16
0
	void ArgumentValue(
#line  1416 "cs.ATG" 
out Expression argumentexpr) {

#line  1418 "cs.ATG" 
		Expression expr;
		FieldDirection fd = FieldDirection.None;
		
		if (la.kind == 93 || la.kind == 100) {
			if (la.kind == 100) {
				lexer.NextToken();

#line  1423 "cs.ATG" 
				fd = FieldDirection.Ref; 
			} else {
				lexer.NextToken();

#line  1424 "cs.ATG" 
				fd = FieldDirection.Out; 
			}
		}
		Expr(
#line  1426 "cs.ATG" 
out expr);

#line  1427 "cs.ATG" 
		argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; 
	}
		public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data) {
			Debug.Assert((directionExpression != null));
			Debug.Assert((directionExpression.Expression != null));
			nodeStack.Push(directionExpression.Expression);
			directionExpression.Expression.AcceptVisitor(this, data);
			directionExpression.Expression = ((Expression)(nodeStack.Pop()));
			return null;
		}
		public sealed override object VisitDirectionExpression(DirectionExpression directionExpression, object data) {
			this.BeginVisit(directionExpression);
			object result = this.TrackedVisitDirectionExpression(directionExpression, data);
			this.EndVisit(directionExpression);
			return result;
		}
Exemplo n.º 19
0
 public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data) {
     throw CreateException(directionExpression);
 }
 public override object TrackedVisitDirectionExpression(DirectionExpression directionExpression, object data)
 {
     Console.WriteLine("VisitDirectionExpression");
     return null;
 }
		public object VisitDirectionExpression(DirectionExpression directionExpression, object data)
		{
			// boo does not need to specify the direction when calling out/ref methods
			return ConvertExpression(directionExpression.Expression);
		}