/// <summary>
        /// Parse the label
        /// </summary>
        /// <param name="knownCodeTypes"></param>
        /// <param name="label"></param>
        /// <param name="name"></param>
        /// <param name="returnType"></param>
        /// <param name="parameters"></param>
        public static void ParseLabel(KnownCodeTypes knownCodeTypes, string label, out string name, out string returnType, out List<KeyValuePair<string, string>> parameters)
        {
            // Verify parenthesis
               int indexBeginningOfParameters = label.IndexOf('(');
               int indexEndOfParametes = label.LastIndexOf(')');
               if ((indexBeginningOfParameters == -1) || (indexEndOfParametes == -1))
            throw new ArgumentException(string.Format("Method signature '{0}' is incorrect : missing parenthesis", label));

               // Find return type, and name
               int indexFirstSpace = label.IndexOf(' ');
               if ((indexFirstSpace == -1) || (indexFirstSpace > indexBeginningOfParameters))
               {
            returnType = "void";
            name = label.Substring(0, indexBeginningOfParameters - 1).Trim();
               }
               else
               {
            returnType = label.Substring(0, indexFirstSpace).Trim();
            if ((knownCodeTypes!=null) && (knownCodeTypes.GetNamedTypes(returnType).Length == 1))
             returnType = knownCodeTypes.GetNamedTypes(returnType)[0].FullName;
            name = label.Substring(indexFirstSpace + 1, indexBeginningOfParameters - 1 - indexFirstSpace).Trim();
               }

               // Parse parameters
               parameters = new List<KeyValuePair<string, string>>();
               if (indexEndOfParametes != -1)
               {
            string parameterString = label.Substring(indexBeginningOfParameters + 1, indexEndOfParametes - 1 - indexBeginningOfParameters);
            string[] parameterArray = parameterString.Split(',');
            if (!string.IsNullOrEmpty(parameterString))
            {
             int parameterIndex = 0;
             foreach (string parameter in parameterArray)
             {
              string aParameterString = parameter.Trim();
              string[] parts = aParameterString.Split(' ');
              string parameterType;
              string parameterName;
              if (parts.Length >= 2)
              {
               parameterType = parts[0];
               parameterName = parts[1];
              }
              else if (parts.Length > 0)
              {
               parameterType = parts[0];
               parameterName = "p" + (parameterIndex + 1).ToString();
              }
              else
               throw new ArgumentException(string.Format("Method signature '{0}' is incorrect (parameter #{1})", label, parameterIndex));

              parameterIndex++;
              if ((knownCodeTypes != null) && (knownCodeTypes.GetNamedTypes(parameterType).Length == 1))
               parameterType = knownCodeTypes.GetNamedTypes(parameterType)[0].FullName;
              parameters.Add(new KeyValuePair<string, string>(parameterName, parameterType));
             }
            }
               }
        }
 /// <summary>
 /// Infers the types from a single type name
 /// </summary>
 /// <param name="knownCodeTypes"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static List<CodeType> InferType(KnownCodeTypes knownCodeTypes, string type)
 {
     return new List<CodeType>(knownCodeTypes.GetNamedTypes(type));
 }