~/talk

How to Parse C++

Talkat C++Online 2025 · 2025-02-26..02-28· [c-and-cpp, compilers-and-language-design]
links:none on file
slides:none on file

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

  1. 0:00Introduction to parsing
  2. 1:08Lexer and tokens
  3. 2:14Syntax trees and grammar
  4. 7:20Descending vs ascending parsers
  5. 16:45C++ grammar complexity
  6. 21:20Declarations in C++
  7. 25:37Most vexing parse
  8. 32:24Backtracking and complexity
  9. 41:04Solving most vexing parse
  10. 51:42Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.