Parsing and Reflective Printing, Bidirectionally
Language designers usually need to implement parsers and printers. Despite being two intimately related programs, in practice they are often designed separately, and then need to be revised and kept consistent as the language evolves. It will be more convenient if the parser and printer can be unified and developed in one single program, with their consistency guaranteed automatically.
Furthermore, in certain scenarios (like showing compiler optimisation results to the programmer), it is desirable to have a more powerful reflective printer that, when an abstract syntax tree corresponding to a piece of program text is modified, can reflect the modification to the program text while preserving layouts, comments, and syntactic sugar.
To address these needs, we propose a domain-specific language BIYacc, whose programs denote both a parser and a reflective printer for an unambiguous context-free grammar. BIYacc is based on the theory of_bidirectional transformations_, which helps to guarantee by construction that the pairs of parsers and reflective printers generated by BIYacc are consistent. We show that BIYacc is capable of facilitating many tasks such as Pombrio et al.’s ‘‘resugaring’’, language evolution, and refactoring.
Mon 31 OctDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
10:30 - 12:10
|Parsing and Reflective Printing, Bidirectionally|
Zirun Zhu National University SOKENDAI, Japan, Yongzhe Zhang National University SOKENDAI, Japan, Hsiang-Shang ‘Josh’ Ko National Institute of Informatics, Pedro Martins University of California at Irvine, USA, João Saraiva University of Minho, Portugal, Zhenjiang Hu National University SOKENDAI, JapanDOI
|Taming Context-Sensitive Languages with Principled Stateful Parsing|
Nicolas Laurent Université Catholique de Louvain, Belgium, Kim Mens Université Catholique de Louvain, BelgiumDOI Pre-print
|MetaEdit+ for Collaborative Language Engineering and Language Use (Tool Demo)|
Juha-Pekka Tolvanen MetaCase, FinlandDOI Pre-print Media Attached
|Efficient Development of Consistent Projectional Editors using Grammar Cells|
Markus Völter itemis, Germany, Tamás Szabó itemis AG / TU Delft, Sascha Lisson itemis AG, Bernd Kolb itemis AG, Sebastian Erdweg Delft University of Technology, Netherlands, Thorsten Berger Chalmers University of Technology, SwedenDOI Pre-print Media Attached