code: def _parse_document(document: Path, system: System = None, profile=EProfile.FULL):
          
          logger.debug('parse document: {0}'.format(document))
          stream = FileStream(str(document), encoding='utf-8')
          system = FileSystem._parse_stream(stream, system, document, profile)
          FileSystem.merge_annotations(system, document.stripext() + '.yaml')
          return system
docs: Parses a document and returns the resulting domain system
  
          :param path: document path to parse
          :param system: system to be used (optional)