The Art of Parsing
summary
SonarSource explains why compiler teams handwrite parsers: generator-friendly grammars are hard to maintain, give poor error recovery, and won’t match the performance or diagnostics needed by javac/GCC/Clang. SonarSource uses parsing expression grammars for about 22 of 24 languages (works well for Java, Python, COBOL), finds PEG a dead end for C/C++, and resorts to generalized parsing (GLL) to handle C/C++ ambiguity. The team builds internal parser generators (not yet open source) and reports GLL yields acceptable performance and preserves all parse alternatives for semantic disambiguation.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 0:14Who are we
- 1:34Todays topic
- 2:45Why handwritten parsers
- 3:08Why so many grammars
- 4:34What is grammar
- 14:42Java
- 15:38L1 parsers
- 16:53L1 recap
- 18:16Parsing Expressions
- 19:58Parsing Grammar
- 20:37Break
- 20:51Jar Program
- 22:56Java Program
- 26:14Semantic Analysis
- 26:47Generalized parsers
- 29:23C grammar
- 30:52Recap
- 32:26Questions
related talks
53m“Parsing C++”
58mParsing in C# from first principles
01h 01mExpressive Compile Time Parsers
29mMy Little Parser: Tooling is Magic
01h 18mExpressive Compile-Time Parsers in C++
39mIs Go A Good Language to Build Compilers?
29mGrammar Inference for Ad Hoc Parsers
01h 02mProgramming Language Research for Technical and Social Good: What PL Can Do for Good?
