Is it feasible to use the yield keyword to implement a simple state machine as shown here. To me it looks like the C# compiler has done the hard work for you as it internally implements a state machine to make the yield statement work.
Can you piggy-back on top of the work the compiler is already doing and get it to implement most of the state machine for you?
Has anyone done this, is it technically possible?