1

My understanding is coroutines vs generators is push vs pull model. Both, I think, can work for parsing, to implement hand-coded recursive descent parser.

Just trying to choose, what are pros and cons. Also would be grateful for code examples.

Edit: the question was marked as a possible duplicate. It is different, I believe. This question is mostly about applicability of coroutines vs generators to the problem of parsing. Not about their differences in general.

martineau
  • 119,623
  • 25
  • 170
  • 301
rincewind
  • 1,103
  • 8
  • 29

0 Answers0