title: Design principle behind a non-stack blowing parser
body: <p>I'm designing a JSON parser for my embedded system. It should come with the protection against stack overflows, meaning that there should be no nested function calls (recursion) or growing storage information. <em>Also no dynamic allocation!</em> How would I in general design such a parser?</p>
  <p>In general I can't really figure out how to save contextual information to return to after processing the lower layers. I could of course just parse the upper layers and then start from the beginning to dive down to the second layer, but that would be really inefficient.</p>