Lexy: A DSL Library For C++ Parsing
summary
lexy is a C++ DSL that implements syntax sugar for a handwritten recursive descent parser giving explicit control over alternatives and backtracking, supports Unicode and binary input, and can produce either lossless parse trees or populate custom data structures with no intermediate copies. it demonstrates automatic error recovery, a reader API with peek/bump to request input incrementally, and a continuation model inspired by sender/receiver style continuations. three real compilers are built on it and the interactive web playground shows it working.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 0:32What is Lexy
- 1:13Simple Lexy example
- 2:38Error recovery
- 3:43Lexy backtracking
- 5:26Advanced Lexy features
- 6:09Parser combinators
- 8:14Value production
- 10:00Rule composition
- 11:23Custom input reader
- 13:49Interactive playground
related talks
01h 01mExpressive Compile Time Parsers
01h 18mExpressive Compile-Time Parsers in C++
22mLex Sleuther - A Novel Approach to Script Language Detection
19mVerbatim++: Verified, Optimized, and Semantically Rich Lexing with Derivatives
53m“Parsing C++”
24mDesigning a DSL That Perfectly Solves Your Problem
46mGrammar a BNF like Ruby DSL Parsing
19mA Library Modeling Language for the Static Analysis of C Programs
