Hacker News new | ask | show | jobs
by aap_ 1630 days ago
I would disagree on that. Parsing theory made it easier to write parsers, not harder. Separating the process into lexical and syntactic analysis makes for a much clearer structure than some ad-hoc parser. And writing a recursive descent parser for a language with an appropriate grammar is not hard and can be quite enjoyable.
2 comments

I don't think recursive decent parsers is what people think of when it's about "parsing theory". In my mind the theory is more about classifying arbitrary languages that were not necessarily designed to be easily parsed by machines, and about models to parse them nevertheless.

If you write a recursive descent parser, you're probably parsing a language that was explicitly designed to be parsed with straightforward code, and that can mean the language is compromising on brevity and expressivity sometimes.

OTOH parsing with a recursive descent parser requires either a machine with a stack and the approriate calling conventions OR a lot of work to fake it. FORTRANs before F90 had no recursion (and you still have to explicitly declare that a function is recursive), and many early and easy architectures have no hardware stack.