Writing parser stack unwinding code