KIT | KIT-Bibliothek | Impressum | Datenschutz

Declarative specification of indentation rules a tooling perspective on parsing and pretty-printing layout-sensitive languages

Souza Amorim, Luís Eduardo de; Steindorfer, Michael J.; Erdweg, Sebastian ORCID iD icon 1; Visser, Eelco
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

In layout-sensitive languages, the indentation of an expression or statement can influence how a program is parsed. While some of these languages (e.g., Haskell and Python) have been widely adopted, there is little support for software language engineers in building tools for layout-sensitive languages. As a result, parsers, pretty-printers, program anal-yses, and refactoring tools often need to be handwritten, which decreases the maintainability and extensibility of these tools. Even state-of-the-art language workbenches have little support for layout-sensitive languages, restricting the development and prototyping of such languages. In this paper, we introduce a novel approach to declarative specification of layout-sensitive languages using layout declarations. Layout declarations are high-level specifications of indentation rules that abstract from low-level technicalities. We show how to derive an efficient layout-sensitive generalized parser and a corresponding pretty-printer automatically from a language specification with layout declarations. We validate our approach in a case-study using a syntax definition for the Haskell programming language, investigating the performance of the generated parser and the correctness of the generated pretty-printer against 22191 Haskell files.


Originalveröffentlichung
DOI: 10.1145/3276604.3276607
Dimensions
Zitationen: 4
Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsdatum 24.10.2018
Sprache Englisch
Identifikator ISBN: 978-145036029-6
KITopen-ID: 1000188590
Erschienen in SLE 2018 - Proceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering, co-located with SPLASH 2018; Boston, MA, USA, 05.-06.11.2018
Veranstaltung 11th ACM SIGPLAN International Conference on Software Language Engineering (2018), Boston, MA, USA, 05.11.2018 – 06.11.2018
Verlag Association for Computing Machinery (ACM)
Seiten S. 3-15
Schlagwörter Computer programming languages; Computer software; Object oriented programming; Printing presses; Specifications; Syntactics
Nachgewiesen in Scopus
Dimensions
OpenAlex
Globale Ziele für nachhaltige Entwicklung Ziel 4 – Hochwertige Bildung
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page