This is a generator that yields all top-level S-expression nodes from
    a given file object.

def read_file(file, filename='<input>'):
    """This is a generator that yields all top-level S-expression nodes from
    a given file object."""
    reader = Reader(filename)
    for line in file:
        yield from reader.feed_line(line)
    reader.finish()