code: def get_paths(src):
      
      st = list()
      tmp = ''
      for let in src:
          if let == '(':
              if tmp != '':
                  st.append(tmp)
                  tmp = ''
          elif let == ')':
              if tmp != '':
                  st.append(tmp)
                  yield st
              st = st[:-1 - (tmp != '')]
              tmp = ''
          elif let == ' ':
              if tmp != '':
                  st.append(tmp)
                  tmp = ''
          else:
              tmp += let
docs: Generates root-to-leaf paths, given a treebank in string format. Note that
      get_path is an iterator and does not return all the paths simultaneously.
  
      :param src: str: treebank
  
      Examples:
          >>> st = "((IP-MAT-SPE (' ') (INTJ Yes) (, ,) (' ') (IP-MAT-PRN (NP-SBJ (PRO he)) (VBD seyde)) (, ,) (' ') (NP-SBJ (PRO I)) (MD shall)	(VB promyse) (NP-OB2 (PRO you)) (IP-INF (TO to)	(VB fullfylle) (NP-OB1 (PRO$ youre) (N desyre))) (. .) (' '))"
  
          Get the sixth generated path:
  
          >>> list(get_paths(st))[5]
          ['IP-MAT-SPE', 'IP-MAT-PRN', 'VBD', 'seyde']