def parse_file(
        self, filename: Path, encoding: Optional[str] = None, debug: bool = False
    ) -> NL:
        """Parse a file and return the syntax tree."""
        with open(filename, encoding=encoding) as stream:
            text = stream.read()
        return self.parse_string(text, debug)
Parse a file and return the syntax tree.
src/blib2to3/pgen2/driver.py