News for hackers. Stuff that matters.
Re:Syntax is the last thing you should design by kazinator on Sunday March 05, 2017 @02:25AM (#13794981)
> But what a hand written parser tends to get you over a parser generator, is better ability to do clean error reporting, and better ease of introspecting how parser changes actually changes the processing in ways that are meaningful to mortals.

Here is the thing: in a hand-written parser, we can more or less have a function corresponding to a grammar feature. And we can can trace the entry and exit of that function and put a breakpoint on it. And that's "`nuff said", pretty much.

Re:Syntax is the last thing you should design by vidarh on Sunday March 05, 2017 @02:48AM (#13795042)
You can do that with parser generators too. But I agree, in that too many parser generators do things like generate tables instead. In the past I've written generators that generate recursive-descent parsers that mimic how I'd handwrite them, and that is a lot easier to debug than table based generated parsers.

But the reason I've not pursued that more is that once you've added in various exceptions, and tree building, and error checking etc., you're not saving all that much over just hand writing the thing entirely.