4 ms·
I've tried to write PEG grammars/parsers and found that I am not quite smart enough to figure it out. Hand-written lexer/parser means you can be dumb as a door
by gavinray 5y ago
I've tried to write PEG grammars/parsers and found that I am not quite smart enough to figure it out.
Hand-written lexer/parser means you can be dumb as a doornail and just walk through the logic.
As an aside, it also gives you a better ability to write error messages, and an easier time debugging compared to autogenerated solutions.
- sanxiyn 5y ago> it also gives you a better ability to write error messages This is not true. Instead of trying to use error recovery feature of parser genrator, you can just add error case to your grammar, and it works as well as hand-written parser. Parser generator error recovery is pure bonus on top. > and an easier time debugging compared to autogenerated solutions This is also not true. Most parser generators (certainly lex/yacc) have good enough debug support that you never see generated code while you debug.