ModelWriter/WP3

Discuss the idea of synchronized token streams of different lexers built on top of ANTLR parser technology

ferhaterata opened this issue · 0 comments

Development of a small domain specific language (DSL) that enable us to synchronize different languages, one of which is translated from the other. We have developed such translations using StringTemplate or StringBuilder. But an ad-hoc approach is employed using a simple trace data structure to map tokens of source language to the corresponding offsets in the target language. And once a notification occurs in the target language, we propagate the impact to source tokens using this data structure. Can we systematically develop an approach starting from this basic data structure to end up with a domain-specific language to achieve this goal? For instance, user can provide two language lexers and parsers to the DSL and provide declarative rules to maintain the synchronization. When we click to a token or a token set in the source language, we can navigate to the corresponding location in the target language and vice versa.

This idea would be actually a part of ModelWriter project that ultimately aims to synchronize different formalism. We need to think about the feasibility of this idea.