First draft of iterator-based scanner-parser interface