SE can be separated into four independent parts:
(i) the difference analysis unit (DAU), which can be
considered the heart of the SE, (ii) a simple parser
unit (U
1
), (iii) the complex incremental textual
update unit (U
2
), and (iv) the visual model
manipulation unit (U
3
). The last mentioned three
units (U
1
, U
2
, and U
3
) serve as language-specific
glue units for the metamodel independent DAU.
Figure 7: The synchronization approach in the details.
The algorithms in the DAU (Figure 7) operate on
the ASTs. The procedures denoted by Diff based on
the algorithms elaborated in (Chawathe et al, 1996)
and have been customized for source code (AST)
difference analysis. A general tree matching
algorithm tries to find the correspondence between
the two trees; the nodes that remained unmatched
compose the differences. The edit scripts can
reconcile the differences between the trees.
The modifications in the two artifacts can affect
each other, since the nodes are identified by their
path. An inserted node can shift the indices and may
cause that an edit operation from the opposite edit
script can address a different node. To avoid this, we
transform (by incrementing or decrementing the
indices) the paths in the operations if they affect
each other. Finally, to propagate the changes, the
transformed edit scripts are executed on the other
side by the generated glue units (U
2
, and U
3
). At the
end of the synchronization we obtain two
syntactically equivalent artifacts.
4 CONCLUSIONS
The accelerated spread of the DSLs requires the
development of tools to support the evolution of
both the visual and textual languages. This means
just the beginning towards the round-trip
engineering and incremental synchronization
between independently, and concurrently evolved
DSL models.
The presented synchronization technique
involves structural syntactic model-text differencing
and three-way AST merging. The main advantage is
that in contrast to typical text generation approaches,
it permits modifying the generated textual artifacts
and instead of losing the changes, they will be
synchronized back to the models. The modular
design allows the model-model and in addition the
text-text synchronization. On models where
semantic conflicts never occur, this approach can be
used efficiently.
ACKNOWLEDGEMENTS
This paper was supported by the János Bolyai
Research Scholarship of the Hungarian Academy of
Sciences.
REFERENCES
Angyal, L., Lengyel L., Charaf, H. 2008. Novel
Techniques for Model-Code Synchronization. In
Proceedings of The 3rd International ERCIM
Workshop on Software Evolution. Electronic
Communication of the EASST, 8.
Angyal, L., Asztalos, M., Lengyel, L., Levendovszky, T.,
Madari, I., Mezei, G., Mészáros, T., Siroki, L., Vajk,
T., 2009. Towards a Fast, Efficient and Customizable
Domain-Specific Modeling Framework. In
Proceedings of the IASTED International Conference.
Innsbruck, Austria.
ANTLR, 2010. ANTLR Parser Generator, http://
www.antlr.org
Chawathe, S. S., Rajaraman, A., Garcia-Molina, H.,
Widom, J., 1996. Change detection in hierarchically
structured information. In: Proceedings of
International Conference on Management of Data,
Montreal, Canada, pp. 493-504.
Eclipse EMF, 2010. http://www.eclipse.org/emf
Fritzson, P., Pop, A., Norling, K., Blom, M., 2008.
Comment- and Indentation Preserving Refactoring and
Unparsing for Modelica. In: Proceedings of 6th
International Modelica Conference, Bielefeld,
Germany, pp. 657-666.
Jouault, F., Bezivin, J., Kurtev, I., 2006. TCS: a DSL for
the specification of textual concrete syntaxes in model
engineering. In: Proceedings of Generative
programming and component engineering. Portland,
USA, pp. 249-254.
Krahn, H., Rumpe, B., Völkel, S., 2007. Integrated
Definition of Abstract and Concrete Syntax for
Textual Languages. In: Model Driven Engineering
Languages and Systems (4735), pp. 286-300.
Mens, T., 2002. A State-of-the-Art Survey on Software
Merging, In: IEEE Transactions on Software
Engineering. 28(5), pp. 449-462.
Xtext, 2010. http://www.eclipse.org/Xtext
TEXTUAL SYNTAX MAPPING CAN ENABLE SYNTACTIC MERGING
311