Grammatical Aspects for Language Descriptions
Andrey Breslav

TL;DR
This paper introduces Grammatic, an aspect-oriented approach to describing programming languages that enhances grammar readability and reduces duplication, facilitating the automatic generation of tools like parsers and pretty-printers.
Contribution
It presents a novel aspect-oriented method for language description that improves readability and minimizes duplication compared to traditional annotated grammars.
Findings
Implemented in open-source tool Grammatic
Enables automatic generation of pretty-printers and syntax highlighters
Reduces grammar duplication and improves readability
Abstract
For the purposes of tool development, computer languages are usually described using context-free grammars with annotations such as semantic actions or pretty-printing instructions. These descriptions are processed by generators which automatically build software, e.g., parsers, pretty-printers and editing support. In many cases the annotations make grammars unreadable, and when generating code for several tools supporting the same language, one usually needs to duplicate the grammar in order to provide different annotations for different generators. We present an approach to describing languages which improves readability of grammars and reduces the duplication. To achieve this we use Aspect-Oriented Programming principles. This approach has been implemented in an open-source tool named Grammatic. We show how it can be used to generate pretty-printers and syntax highlighters.
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
TopicsAdvanced Software Engineering Methodologies · Software Engineering Research · Model-Driven Software Engineering Techniques
