3 ms·
>Most people readily agree that recursive descent parsers can provide the best possible error messages, Well, it could, but not all of them do. My hand-writte
by benibela 6y ago
>Most people readily agree that recursive descent parsers can provide the best possible error messages,
Well, it could, but not all of them do.
My hand-written parsers are pretty bad at it. At the lowest level I run through a string char by char and test whether it parses correctly, i.e. like: p++; if (*p != '(') throw "expected (";
At first this does not even give a line number with the error.