code: def module_entry(yfile):
      
      ytxt = yfile.read()
      mp = ModuleParser(ytxt)
      mst = mp.statement()
      submod = mst.keyword == "submodule"
      import_only = True
      rev = ""
      features = []
      includes = []
      rec = {}
      for sst in mst.substatements:
          if not rev and sst.keyword == "revision":
              rev = sst.argument
          elif import_only and sst.keyword in data_kws:
              import_only = False
          elif sst.keyword == "feature":
              features.append(sst.argument)
          elif submod:
              continue
          elif sst.keyword == "namespace":
              rec["namespace"] = sst.argument
          elif sst.keyword == "include":
              rd = sst.find1("revision-date")
              includes.append((sst.argument, rd.argument if rd else None))
      rec["import-only"] = import_only
      rec["features"] = features
      if submod:
          rec["revision"] = rev
          submodmap[mst.argument] = rec
      else:
          rec["includes"] = includes
          modmap[(mst.argument, rev)] = rec
docs: Add entry for one file containing YANG module text.
  
      Args:
          yfile (file): File containing a YANG module or submodule.