public override object Visit(InvocationExpression invocationExpression, object data)
 {
     Console.WriteLine(invocationExpression.ToString());
     return invocationExpression.AcceptChildren(this, data);
 }
 public override object Visit(InvocationExpression invocationExpression, object data)
 {
     if (invocationExpression.TargetObject is FieldReferenceExpression) {
         FieldReferenceExpression field = (FieldReferenceExpression)invocationExpression.TargetObject;
         IReturnType type = field.TargetObject.AcceptVisitor(this, data) as IReturnType;
         ArrayList methods = resolver.SearchMethod(type, field.FieldName);
         resolver.ShowStatic = false;
         if (methods.Count <= 0) {
             return null;
         }
         // TODO: Find the right method
         return ((IMethod)methods[0]).ReturnType;
     } else if (invocationExpression.TargetObject is IdentifierExpression) {
         string id = ((IdentifierExpression)invocationExpression.TargetObject).Identifier;
         if (resolver.CallingClass == null) {
             return null;
         }
         IReturnType type = new ReturnType(resolver.CallingClass.FullyQualifiedName);
         ArrayList methods = resolver.SearchMethod(type, id);
         resolver.ShowStatic = false;
         if (methods.Count <= 0) {
             return null;
         }
         // TODO: Find the right method
         return ((IMethod)methods[0]).ReturnType;
     }
     // invocationExpression is delegate call
     IReturnType t = invocationExpression.AcceptChildren(this, data) as IReturnType;
     if (t == null) {
         return null;
     }
     IClass c = resolver.SearchType(t.FullyQualifiedName, resolver.CompilationUnit);
     if (c.ClassType == ClassType.Delegate) {
         ArrayList methods = resolver.SearchMethod(t, "invoke");
         if (methods.Count <= 0) {
             return null;
         }
         return ((IMethod)methods[0]).ReturnType;
     }
     return null;
 }