[RFC] support for generators

I'm not even sure if this couldn't be applied to Iterators in general, or if it's the correct approach, but at least it resolves parts of the problem of phpspec/phpspec#379.