Title :
Staged model-driven generators: Shifting responsibility for code emission to embedded metaprograms
Author :
Lilis, Yannis ; Savidis, Anthony ; Valsamakis, Yannis
Author_Institution :
Inst. of Comput. Sci., FORTH, Heraklion, Greece
Abstract :
We focus on MDE tools generating source code, entire or partial, providing a basis for programmers to introduce custom system refinements and extensions. The latter may introduce two maintenance issues once code is freely edited: (i) if source tags are affected model reconstruction is broken; and (ii) code inserted without special tags is overwritten on regeneration. Additionally, little progress has been made in combining sources whose code originates from multiple generative tools. To address these issues we propose an alternative path. Instead of generating code MDE tools generate source fragments as abstract syntax trees (ASTs). Then, programmers deploy metaprogramming to manipulate, combine and insert code on-demand from ASTs with calls resembling macro invocations. The latter shifts responsibility for source code emission from MDE tools to embedded metaprograms and enables programmers control where the produced code is inserted and integrated. Moreover, it supports source regeneration and model reconstruction causing no maintenance issues since MDE tools produce non-editable ASTs. We validate our proposition with case studies involving a user-interface builder and a general purpose modeling tool.
Keywords :
automatic programming; program compilers; software maintenance; source code (software); ASTs; MDE tools; abstract syntax trees; embedded metaprograms; general purpose modeling tool; metaprogramming; model reconstruction; multiple generative tools; source code emission; source code generation; source fragments; staged model-driven generators; user-interface builder; Abstracts; Context; Generators; Maintenance engineering; Manuals; Runtime; Unified modeling language; Code Generation; Compile-Time Metaprogramming; Model-Driven Engineering; Multistage Languages;
Conference_Titel :
Model-Driven Engineering and Software Development (MODELSWARD), 2014 2nd International Conference on
Conference_Location :
Lisbon
Print_ISBN :
978-9-8975-8065-9