Parsers with Error Recovery

I’ve seen this talk recently. It’s focused on code transformation but basically is a parser able to generate parser combinators from my understanding. I suppose it’s a bit far from your concern but maybe there is something useful in his work so I’ll share anyway:

1 Like

Released what I have done so far.

On the whole, I’m not completely satisfied with the result, but at least I have a recoverable implementation of sequence which is enough for me to work with for now.

The main issue for my dissatisfaction is that using recovery tactics might recover from an immediate problem, but if that is nested inside something else, the recovery is not going to take the full context into account. So if you had a List embedded inside some other code, but you left out the closing ], it might fast foward to a , higher up the syntax tree inside a parent list, or a tuple, and then things will just get in a mess. What is really needed is a way to neatly tie up all the loose ends as the parser recovers up through higher levels of the tree - and that is what the algorithms in the ‘ell’ parser paper do.

The full auto error recovery implementation will have to wait for another time, as I already spent too long getting this far, but I feel sure the idea is viable.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.