“Parsing C++”
summary
C++ parsing requires semantic name lookup and often arbitrary lookahead so parsers must perform type lookup, evaluate constexprs and handle template-dependent lexing rather than just follow a context-free grammar. Real tooling (JetBrains CLion, Clang-based tools) copes by mixing parsing with semantic analysis, adding disambiguation hacks like most vexing parse workarounds and typename annotations, and still sees compilers produce inconsistent diagnostics; modules promise improvement but introduce new tooling integration challenges.
AI-written summary · about
chapters (20)
- 0:00Introduction to parsing C++
- 1:07C++ compiler basics and lexer
- 3:20C++ grammar and ambiguities
- 6:18Ambiguities in C vs C++
- 9:31Constructors and parsing challenges
- 12:40Most vexing parse explained
- 15:31Rewinding and disambiguation in parsing
- 18:46Declarators with parentheses
- 21:13Initializers in control flow
- 22:39More vexing parse examples
- 26:52Impact of grammar on tooling
- 33:00Templates and parsing difficulties
- 35:37Why tooling struggles with C++
- 37:30Compiler error messages and recovery
- 41:27Error recovery in IDEs
- 43:40Designing new C++ features
- 44:46Future of C++ syntax and modules
- 48:26Q&A: Generic C++ parser
- 49:07Q&A: Modules and tooling
- 50:58Q&A: Modules and preprocessor
related talks
37mThe Art of Parsing
01h 01mExpressive Compile Time Parsers
01h 18mExpressive Compile-Time Parsers in C++
45mC++ is a Metacompiler
58mParsing in C# from first principles
55mHow to Implement Your First Compiler Feature:The Story of Concepts in Clang
29mMy Little Parser: Tooling is Magic
01h 48mBoost.Parser (Part 2 of 2) - A Parser Combinator Library for C++
