docs: def _parse(self):
          """Parses the input file's content and generates a list of its elements/docstrings.
  
          :returns: the list of elements
  
          """
          #TODO manage decorators
          #TODO manage default params with strings escaping chars as (, ), ', ', #, ...
          #TODO manage elements ending with comments like: def func(param): # blabla
          elem_list = []
          reading_element = None
          reading_docs = None
          waiting_docs = False
          elem = ''
          raw = ''
          start = 0
          end = 0
  
          try:
              if self.input_file == '-':
                  fd = sys.stdin
              else:
                  fd = open(self.input_file)
  
              self.input_lines = fd.readlines()
  
              if self.input_file != '-':
                  fd.close()
  
          except IOError:
              msg = BaseException('Failed to open file "' + self.input_file + '". Please provide a valid file.')
              raise msg
          for i, ln in enumerate(self.input_lines):
              l = ln.strip()
              if reading_element:
                  elem += l
                  if l.endswith(':'):
                      reading_element = 'end'
              elif (l.startswith('def ') or l.startswith('class ')) and not reading_docs:
                  if self.ignore_private and l[l.find(' '):].strip().startswith("__"):
                      continue
                  reading_element = 'start'
                  elem = l
                  m = re.match(r'^(\s*)[dc]{1}', ln)
                  if m is not None and m.group(1) is not None:
                      spaces = m.group(1)
                  else:
                      spaces = ''
                  if re.search(r''':(|\s*#[^'"]*)$''', l):
                      reading_element = 'end'
              if reading_element == 'end':
                  reading_element = None
                  # if currently reading an element content
                  waiting_docs = True
                  # *** Creates the DocString object ***
                  e = DocString(elem.replace('\n', ' '), spaces, quotes=self.quotes,
                                input_style=self.input_style,
                                output_style=self.output_style,
                                first_line=self.first_line,
                                **self.kwargs)
                  elem_list.append({'docs': e, 'location': (-i, -i)})
              else:
                  if waiting_docs and ('"""' in l or "'''" in l):
                      # start of docstring bloc
                      if not reading_docs:
                          start = i
                          # determine which delimiter
                          idx_c = l.find('"""')
                          idx_dc = l.find("'''")
                          lim = '"""'
                          if idx_c >= 0 and idx_dc >= 0:
                              if idx_c < idx_dc:
                                  lim = '"""'
                              else:
                                  lim = "'''"
                          elif idx_c < 0:
                              lim = "'''"
                          reading_docs = lim
                          raw = ln
                          # one line docstring
                          if l.count(lim) == 2:
                              end = i
                              elem_list[-1]['docs'].parse_docs(raw)
                              elem_list[-1]['location'] = (start, end)
                              reading_docs = None
                              waiting_docs = False
                              reading_element = False
                              raw = ''
                      # end of docstring bloc
                      elif waiting_docs and lim in l:
                          end = i
                          raw += ln
                          elem_list[-1]['docs'].parse_docs(raw)
                          elem_list[-1]['location'] = (start, end)
                          reading_docs = None
                          waiting_docs = False
                          reading_element = False
                          raw = ''
                      # inside a docstring bloc
                      elif waiting_docs:
                          raw += ln
                  # no docstring found for current element
                  elif waiting_docs and l != '' and reading_docs is None:
                      waiting_docs = False
                  else:
                      if reading_docs is not None:
                          raw += ln
          if self.convert_only:
              i = 0
              while i < len(elem_list):
                  if elem_list[i]['docs'].get_input_docstring() is None:
                      elem_list.pop(i)
                  else:
                      i += 1
          self.docs_list = elem_list
  
          self.parsed = True
          return elem_list