private void parseFunction(String declaration) {
    int parametersStart = declaration.indexOf("(");
    int parametersEnd = declaration.indexOf(")");
    valid = parametersStart >= 0 && parametersEnd >= 0;
    if (valid) {
      String parametersString = declaration.substring(parametersStart + 1, parametersEnd).trim();
      parameters = (parametersString.length() == 0) ? null : parametersString.split(",");
      declaration = declaration.substring(0, parametersStart).trim();
      int typeSeparationIndex = declaration.lastIndexOf("*");
      if (typeSeparationIndex < 0) {
        typeSeparationIndex = declaration.lastIndexOf(" ");
      }
      returnType = (typeSeparationIndex < 0) ? "" : declaration.substring(0, typeSeparationIndex + 1).trim();
      identifier = declaration.substring(typeSeparationIndex + 1).trim();
      for (int i = 0; parameters != null && i < parameters.length; i++) {
        parameters[i] = parameters[i].trim();
      }
    }
  }