Parsing: How to make error recovery in grammars like " a* b*"?
- by Lavir the Whiolet
Let we have a grammar like this:
Program ::= a* b*
where "*" is considered to be greedy.
I usually implement "*" operator naively:
Try to apply the expression under "*" to input one more time.
If it has been applied successfully then we are still under current "*"-expression; try to apply the expression under "*" one more time.
Otherwise we…