Recognising and Generating Terms using Derivatives of Parsing Expression Grammars
Tony Garnock-Jones, Mahdi Eslamimehr, Alessandro Warth

TL;DR
This paper extends the concept of derivatives from regular expressions to Parsing Expression Grammars (PEGs), enabling recognition and generation of sentences, and offers a new tool for language designers to predict parser behavior.
Contribution
It introduces a novel derivative-based technique for PEGs, facilitating sentence generation and broader applications in language design and implementation.
Findings
Derived derivatives for PEGs enable sentence recognition and generation.
The approach generalizes to other grammatical formalisms with derivatives.
Provides a foundation for improved tool support for PEG-based language design.
Abstract
Grammar-based sentence generation has been thoroughly explored for Context-Free Grammars (CFGs), but remains unsolved for recognition-based approaches such as Parsing Expression Grammars (PEGs). Lacking tool support, language designers using PEGs have difficulty predicting the behaviour of their parsers. In this paper, we extend the idea of derivatives, originally formulated for regular expressions, to PEGs. We then present a novel technique for sentence generation based on derivatives, applicable to any grammatical formalism for which the derivative can be defined--now including PEGs. Finally, we propose applying derivatives more generally to other problems facing language designers and implementers.
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.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Natural Language Processing Techniques · Software Engineering Research
