Error Recovery

According to some opinions error recover is not worth it

  • one error tends to trigger others
  • report error and stop
  • put cursor on the error
  • restart when user fixes it

Approaches to error recovery in recursive descent parsing:

  • insert some tokens (hard to guarantee termination)
  • skip some tokens: when parsing X, skip until follow(X) or EOF