Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would you painstaikingly handcraft a recursive descent parser because the generator doesn't give you nice error messages?


That's a fairly normal approach, yes [1]. It's not so painstaking. There are parser generators other than lex and yacc that do a better job, but making most generators produce good errors and handle your context-sensitive tokenisation is more effort overall than making an equivalent hand-written parser (be it near-Pratt, PEG, general recursive descent or anything else).

[1] https://notes.eatonphil.com/parser-generators-vs-handwritten...




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: