docstr: Opens, reads and parses a file.
docstr_tok: ["Opens",",","reads","and","parses","a","file","."]
code: def read(self, path):
      """Opens, reads and parses a file."""
      lines = readlines(path)
      for line in lines:
          if not line.strip():
              continue
          m = identifierRE.match(line)
          if m is None:
              raise error("syntax error in AFM file: " + repr(line))
  
          pos = m.regs[1][1]
          word = line[:pos]
          rest = line[pos:].strip()
          if word in self._keywords:
              continue
          if word == "C":
              self.parsechar(rest)
          elif word == "KPX":
              self.parsekernpair(rest)
          elif word == "CC":
              self.parsecomposite(rest)
          else:
              self.parseattr(word, rest)
  
imports: import re
label_desc: Use image node_id 2 for calling the AFM obj's underlying member method code with example usage: obj.read(path) without return types