How to Parse C++
summary
Shows why C++ forces hand-written recursive descent in practice (Clang, GCC) and pinpoints ambiguous constructs: left recursion, overlapping prefixes, the most-vexing parse, and deeply nested template instantiations that trigger exponential backtracking (parsers fail past ~10 nesting levels). Proposes a practical fix: track token positions and push successful subparses into a state cache so the parser reuses results instead of re-parsing, converting worst-case exponential behavior into linear time; includes worked examples, algorithm sketch, slides and measured improvement.
AI-written summary · about
