Parsing Expression Grammars Made Practical
Nicolas Laurent, Kim Mens

TL;DR
This paper introduces Autumn, a practical PEG parser that supports left-recursion, associativity, and precedence, addressing limitations of previous PEG implementations and improving efficiency and extensibility.
Contribution
The paper presents Autumn, a PEG parser supporting left-recursion, associativity, and precedence, with efficient handling of infix/postfix operators and customizable features.
Findings
Autumn supports left-recursion and precedence rules.
Autumn outperforms existing PEG parsers in efficiency.
The parser is highly extensible with custom operators and error handling.
Abstract
Parsing Expression Grammars (PEGs) define languages by specifying recursive-descent parser that recognises them. The PEG formalism exhibits desirable properties, such as closure under composition, built-in disambiguation, unification of syntactic and lexical concerns, and closely matching programmer intuition. Unfortunately, state of the art PEG parsers struggle with left-recursive grammar rules, which are not supported by the original definition of the formalism and can lead to infinite recursion under naive implementations. Likewise, support for associativity and explicit precedence is spotty. To remedy these issues, we introduce Autumn, a general purpose PEG library that supports left-recursion, left and right associativity and precedence rules, and does so efficiently. Furthermore, we identify infix and postfix operators as a major source of inefficiency in left-recursive PEG…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
