3 ms·
Some grammars can't be parsed recursive descent. At least if I remember parsing class from decades ago they can't.
by dboreham 5y ago
Some grammars can't be parsed recursive descent. At least if I remember parsing class from decades ago they can't.
- samus 5y agoThere are techniques that help parsers parse a far larger class of grammars than their underlying model permits. Some of these are: - turning it into a state machine (required to deal with nested comments and C++ template syntax) - building the symbol table while parsing and querying for disambiguation - treating expressions as a stream of atoms and using a specialised precedence parser (probably required to deal with operator overloading) Parser generators usually employ these as well.
- mbrodersen 5y agoNot true in practice. C++ is one of the hardest practical languages to parse. And it can be parsed using a recursive descent scanner less parser.