4 ms·
What context or data would constitute a helpful error message in your opinion? Do you have an example of a recursive-descent parser that generates particularly
by jhpriestley 8y ago
What context or data would constitute a helpful error message in your opinion? Do you have an example of a recursive-descent parser that generates particularly good error messages?
- chrisseaton 8y agoA great example is if you forget to put 'end' at the end of a function at the end of a file in languages that have that. Your idea of a good parser error message is being told that the end of file was unexpected and being given a list of a hundred possible tokens that could start another statement, including 'end' buried somewhere in the list, because that's what's valid there. My idea of a good parser error message would be in a recursive descent parser looking for the 'end' token, not seeing it, seeing that it's end of file instead and saying 'missing 'end' or a new statement at end of file'.
- nicoburns 8y agoSee elm and rust for examples of compilers with good error messages.
- grandmczeb 8y agoOr clang.