Parsing Reflective Grammars
Paul Stansifer, Mitchell Wand

TL;DR
This paper introduces reflective grammars that can modify their syntax during parsing, enabling more flexible language extension, and presents a correct, efficient parsing algorithm based on Earley's algorithm.
Contribution
It proposes a novel reflective grammar framework and an Earley-based parsing algorithm that supports dynamic syntax modifications during parsing.
Findings
The algorithm correctly parses reflective grammars.
Performance is asymptotically comparable to Earley's algorithm.
Reflective grammars enable more powerful syntax extension systems.
Abstract
Existing technology can parse arbitrary context-free grammars, but only a single, static grammar per input. In order to support more powerful syntax-extension systems, we propose reflective grammars, which can modify their own syntax during parsing. We demonstrate and prove the correctness of an algorithm for parsing reflective grammars. The algorithm is based on Earley's algorithm, and we prove that it performs asymptotically no worse than Earley's algorithm on ordinary context-free grammars.
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
TopicsModel-Driven Software Engineering Techniques · Software Testing and Debugging Techniques · Natural Language Processing Techniques
