Creating modular and reusable DSL textual syntax definitions with Grammatic/ANTLR
Andrey Breslav

TL;DR
This paper introduces Grammatic, a tool that enhances modularity and reuse in textual syntax definitions for parser generators like ANTLR, by applying separation of concerns and template techniques.
Contribution
Grammatic provides a novel approach to modular grammar development, enabling separation of concerns and reuse without building ASTs, improving maintainability and efficiency.
Findings
Demonstrated effective separation of concerns in ANTLR grammars
Enabled grammar reuse through templates
Improved development efficiency without AST overhead
Abstract
In this paper we present Grammatic -- a tool for textual syntax definition. Grammatic serves as a front-end for parser generators (and other tools) and brings modularity and reuse to their development artifacts. It adapts techniques for separation of concerns from Apsect-Oriented Programming to grammars and uses templates for grammar reuse. We illustrate usage of Grammatic by describing a case study: bringing separation of concerns to ANTLR parser generator, which is achieved without a common time- and memory-consuming technique of building an AST to separate semantic actions from a grammar definition.
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
TopicsLogic, programming, and type systems · Model-Driven Software Engineering Techniques · Advanced Software Engineering Methodologies
