6 ms·
It's trivial to replace the stack usage with a data structure. I've written a number of extended-Pratt parsers that don't use the stack. Also, a significant nu
by ghusbands 6y ago
It's trivial to replace the stack usage with a data structure. I've written a number of extended-Pratt parsers that don't use the stack.
Also, a significant number of successful parsers have used recursion. As long as you successfully handle stack overflow and only hit it on pathological inputs, it works reasonably well.
- zamalek 6y ago> It's trivial to replace the stack usage with a data structure. Interesting. Do you have any examples of that, reading the article actually had me thinking how that would be achieved.
- flashmozzg 6y agoYou could trivially (or rather, mechanically) emulate HW bounded stack with a heap-based stack collection (like std::stack).