Lexy: A C++ Parser Library Rivaling PEG Parsers
2025-09-14
Lexy is a high-performance C++ parser library that strikes a balance between performance and control. Compared to other PEG parsers like Boost.Spirit and PEGTL, Lexy avoids implicit backtracking by controlling branch conditions, improving performance and simplifying error handling. Lexy supports advanced features like error recovery, operator precedence parsing, and allows zero-copy parsing directly into your own data structures. While Lexy's grammar is more verbose than Boost.Spirit's, it's better suited for larger grammars. Compilation times are reasonable, and modular design helps optimize build speed.
Development