4 ms·
Getting good error messages from the parser generator is a solved problem, but it seems that solution is not widely known. As you said, it isn't possible to ge
by sanxiyn 13y ago
Getting good error messages from the parser generator is a solved problem, but it seems that solution is not widely known.
As you said, it isn't possible to get good error messages automatically. The solution is to include error cases in the grammar. No hooking is necessary. If people often miss semicolons, include missing semicolon case in the grammar!
Mono C# compiler uses this technique (including error cases in the grammar) to the great effect. I wonder why people don't do that and resort to hand-written parsers instead.
- mattfenwick 13y agoExcellent, this -- information on other people's strategies for generating good error messages -- is exactly what I've been looking for. Could you direct me to more resources/papers/tools that describe and apply this approach in practice? Thanks!