Incremental, bidirectional text-to-text synchronizations with AnyText
Abstract
Maintaining consistency across heterogeneous textual DSLs that describe the same system is a recurring challenge in software language engineering. We advocate a separation of concerns: (i) language-specific model-to-text synchronizations that relate the concrete syntax to its abstract representation as a model, and (ii) heterogeneous model-to-model synchronizations that capture the semantic overlap between languages. We extend the AnyText language workbench with a generic, grammar-based, incremental, bidirectional model-to-text synchronization by integrating its incremental parser and pretty-printer to propagate edits and support round-trip updates. Composing two such model-to-text synchronizations with an online-incremental, bidirectional model-to-model synchronization yields an end-to-end, modular, incremental, bidirectional text-to-text synchronization pipeline across DSLs. We demonstrate and evaluate the approach by synchronizing finite state machines and Petri nets, indicating a good performance of our approach also for large text documents. An open-source implementation is available under a BSD-3 license as part of NMF.