Declarative Specification of Indentation Rules: A Tooling Perspective on Parsing and Pretty-Printing Layout-Sensitive Languages
In layout-sensitive languages, the indentation of an expression or statement can influence how a program is parsed. While some layout-sensitive languages (e.g., Python) have wide adoption in practice, there is little support for software language engineers in building tools for layout-sensitive languages. As a result, parsers, pretty-printers, program analyses, or refactorings often need to be handwritten, which decreases the maintainability and extensibility of these tools. Even state-of-the-art language workbenches have yet little support for layout-sensitive languages, restricting the development and prototyping of such languages.
To ease dealing with layout-sensitive languages in practice, we introduce a novel approach to support declarative specifications of layout-sensitive languages using layout declarations. Layout declarations are high-level specifications of indentation rules that occur in layout-sensitive languages, abstracting from low-level technicalities. We show how to automatically derive an efficient layout-sensitive generalized parser and a corresponding pretty-printer 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 when considering a corpus of 22191 Haskell files.
Mon 5 Nov Times are displayed in time zone: Guadalajara, Mexico City, Monterrey change
10:30 - 12:00: ParsingSLE 2018 at Studio 1 Chair(s): Tijs van der StormCWI & University of Groningen | |||
10:30 - 11:00 Talk | Declarative Specification of Indentation Rules: A Tooling Perspective on Parsing and Pretty-Printing Layout-Sensitive Languages SLE 2018 Luis Eduardo de Souza AmorimDelft University of Technology, Netherlands, Michael J. SteindorferDelft University of Technology, Sebastian ErdwegTU Delft, Eelco VisserDelft University of Technology Link to publication DOI | ||
11:00 - 11:30 Talk | GLL Parsing with Flexible Combinators SLE 2018 L. Thomas van BinsbergenRoyal Holloway University of London, Elizabeth ScottRoyal Holloway University of London, Adrian Johnstone File Attached | ||
11:30 - 12:00 Talk | Morbig: A Static Parser for POSIX Shell SLE 2018 Yann Régis-GianasIRIF, University Paris Diderot and CNRS, France / INRIA PI.R2, Nicolas JeannerodIRIF, University Paris Diderot and CNRS, France, Ralf TreinenIRIF |