3 ms·
There's a reason both GCC and clang use hand rolled recursive descent parsers... Another thing about recursive descent, besides the ability to generate very sp
by userbinator 11y ago
There's a reason both GCC and clang use hand rolled recursive descent parsers...
Another thing about recursive descent, besides the ability to generate very specific error messages, is that it's a naturally intuitive algorithm which is very similar to how humans mentally parse. Perhaps that's also why context-sensitivity is not a problem at all, since natural languages are AFAIK all context-sensitive.
Parser generators are complex, generate huge amounts of virtually undebuggable code, and require learning another language, yet are less flexible than recursive-descent. It's clear why they've fallen out of favour in comparison to simpler and more flexible parsing algorithms.
- mattkrause 11y agoNatural languages are reasonably close to context-free, actually. There are some freaky constructions in Dutch and (some variants of) German that can't be generated by a CFG. They sometimes get called mildly context-sensitive.