code: def parse(self, text, fn=None):
          
  
          if PY2 and not isinstance(text, unicode):
              # specify Unicode for Python 2.7
              text = unicode(text, 'utf-8')
  
          if self.expand_includes:
              text = self.load_includes(text, fn=fn)
  
          try:
              self._comments[:] = []  # clear any comments from a previous parse
              tree = self.lalr.parse(text)
              if self.include_comments:
                  self.assign_comments(tree, self._comments)
              return tree
          except (ParseError, UnexpectedInput) as ex:
              if fn:
                  log.error("Parsing of {} unsuccessful".format(fn))
              else:
                  log.error("Parsing of Mapfile unsuccessful")
              log.info(ex)
              raise
docs: Parse the Mapfile