iterator(id) matches { name: 'iterator', resultId: id };
hasNext(id, res) matches { name: 'hasNext', result: res, targetId: id };
next(id) matches { name: 'next', targetId: id };
Main = empty ∨ { let id; iterator(id)
(Main | (hasNext(id, true) next(id))* hasNext(id, false))
};