'Create a generator to iterate on each field, may create new
fields when needed'

def __iter__(self):

    try:
        done = 0
        while True:
            if (done == len(self._fields)):
                if (self._field_generator is None):
                    break
                self._addField(self._field_generator.next())
            for field in self._fields.values[done:]:
                (yield field)
                done += 1
    except HACHOIR_ERRORS as err:
        field = self._fixFeedError(err)
        if isinstance(field, Field):
            (yield field)
        elif hasattr(field, '__iter__'):
            for f in field:
                (yield f)
        elif (field is False):
            raise
    except StopIteration:
        field = self._stopFeeding()
        if isinstance(field, Field):
            (yield field)
        elif hasattr(field, '__iter__'):
            for f in field:
                (yield f)
