Abstract
In software development, domain-specific languages (DSLs) are often applied for specific or repetitive tasks. For executable DSLs, a model interpreter can be developed to run DSL programs. Nevertheless, it is more widespread to generate code in a general-purpose programming language. A properly chosen DSL expresses the original problem more naturally for both domain and information technology experts, and thus, this approach makes the whole development process, especially requirements engineering and requirements analysis, more efficient and less prone to human errors. There are code generator frameworks and so-called language workbenches available that make the development of code generators for DSLs easier. In this paper, we report on our own code generator framework, called Meta3. Meta3 is based on our code generator development experience. We believe that this experience report will be useful for developers of code generators and language workbenches interested in building more flexible and robust code generators as well as better tools that support the construction of the latter.
Similar content being viewed by others
Notes
The question may arise, why is this representation necessary and why the syntax tree cannot be a model. In fact, it may be used as a model but the elements of the model also carry semantic meaning, whereas the syntax tree does not. Moreover, the model is usually redundancy free and designed consciously to be a concise and intuitive representation of the information.
References
Fowler, M.: Domain-Specific Languages. Addison-Wesley, Boston (2010)
Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison-Wesley, Boston (2006)
Bettini, L.: Implementing Domain-Specific Languages with Xtext and Xtend. Packt Publishing, Birmingham (2013)
Kuhn, A., Murphy, G.C., Thompson, C.A.: An exploratory study of forces and frictions affecting large-scale model-driven development. In: Model Driven Engineering Languages and Systems. MODELS 2012. Lecture Notes in Computer Science, vol. 7590. Springer, Berlin, Heidelberg (2012)
Kövesdán, G., Asztalos, M., Lengyel, L.: Modeling cloud messaging with a domain-specific modeling language. In: CloudMDE, A Workshop to Explore Combining Model-Driven Engineering and Cloud Computing. In Conjunction with MODELS 2014 (2014)
Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF: Eclipse Modeling Framework, 2nd edn. Addison-Wesley Professional, Boston (2008)
Parr, T.: The Definitive ANTLR 4 Reference, 2nd edn. Pragmatic Bookshelf, Dallas (2013)
Kövesdán, G., Asztalos, M., Lengyel, L.: Polymorphic templates. In: XM 2014 Extreme Modeling Workshop, in Conjunction with MODELS 2014 (2014)
Voelter, M.: Jenerator-generative programming for Java. In: Workshop on Generative Programming, OOPSLA (2001)
Sugar4j Website. http://sugar4j.sourceforge.net/index.html. Accessed 27 Mar 2018
Baracchi, L., Mazzini, S., Puri, S., Vardanega, T.: Lessons learned in a journey toward correct-by-construction model-based development. In: Reliable Software Technologies—Ada-Europe. Lecture Notes in Computer Science, vol. 9695, pp. 113–128 (2016)
Bergmann, G., Dávid, I., Hegedűs, Á., Horváth, Á., Ráth, I., Ujhelyi, Z., Varró, D.: Viatra 3: a reactive model transformation platform. In: Theory and Practice of Model Transformations. Lecture Notes in Computer Science, vol. 9152, pp. 101–110 (2015)
Frankel, D.S.: Model Driven Architecture: Applying MDA to Enterprise Computing. Wiley, New York (2003)
Thomas, D.: UML—Unified or Universal Modeling Language? UML2, OCL, MOF, EDOC—the emperor has too many clothes. J. Object Technol. 2(1), 7–12 (2003)
Kelly, S., Tolvanen, J.-P.: Domain-Specific Modeling: Enabling Full Code Generation. Wiley-IEEE Computer Society, New York (2008)
Jörges, S.: Construction and Evolution of Code Generators—A Model-Driven and Service-Oriented Approach. Lecture Notes in Computer Science, vol. 7747. Springer, Berlin (2013)
Edwards, G., Brun, Y., Medvidovic, N.: Automated analysis and code generation for domain-specific models. In: Working IEEE/IFIP Conference in Software Architecture, IEEE, 2012, pp. 161–170. IEEE (2012)
Reiter, T., Kapsammer, E., Retschitzegger, W., Schwinger, W., Stumptner, M.: A generator framework for domain-specific model transformation languages. In: Proceedings of the 8th International Conference on Enterprise Information Systems (ICEIS), Paphos (2006)
Schmitt, C., Kuckuk, S., Kostler, H., Hannig, F., Teich, J.: An evaluation of domain-specific language technologies for code generation. In: Proceedings of International Conference on Computational Science and its Applications. IEEE Computer Society
Erdweg, S., van der Storm, T., Völter, M., Tratt, L., Bosman, R., Cook, W., Gerritsen, A., Hulshout, A., Kelly, S., Loh, A., Konat, G., Molina, P.J., Palatnik, M., Pohjonen, R., Schindler, E., Schindler, K., Solmi, R., Vergu, V., Visser, E., van der Woning, J.: Evaluating and comparing language workbenches: existing results and benchmarks for the future. Comput. Lang. Syst. Struct. 44, 24–47 (2015)
Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A language and toolset for program transformation. Sci. Comput. Program. 72(1–2), 52–70 (2008)
Visser, E.: Declare your own language. Online book. https://github.com/MetaBorgCube/declare-your-language. Accessed 27 Mar 2018
Naujokat, S., Lybecait, M., Kopetzki, D., Steffen, B.: CINCO: a simplicity-driven approach to full generation of domain-specific graphical modeling tools. Int. J. Softw. Tools Technol. Transf. (2015). https://doi.org/10.1007/s10009-017-0453-6
Eclipse Graphiti Website. https://www.eclipse.org/graphiti/. Accessed 27 Mar 2018
The Meta Programming System Website. https://www.jetbrains.com/mps/. Accessed 27 Mar 2018
MetaEdit+ Website. http://www.metacase.com/mwb/. Accessed 27 Mar 2018
The Visual Modeling and Transformation System Website. https://www.aut.bme.hu/Pages/Research/VMTS/Introduction. Accessed 27 Mar 2018
DMS Software Reengineering Toolkit Website. http://www.semdesigns.com/Products/DMS/DMSToolkit.html. Accessed 27 Mar 2018
Ensō Website. http://enso-lang.org/. Accessed 27 Mar 2018
Rascal Website. http://www.rascal-mpl.org/. Accessed 27 Mar 2018
AnyDSL Website. https://anydsl.github.io/. Accessed 27 Mar 2018
Acknowledgements
This work was performed in the frame of FIEK_16-1-2016-0007 project, implemented with the support provided from the National Research, Development and Innovation Fund of Hungary, financed under the FIEK_16 funding scheme. This work was partially supported by the CONCERTO (ART-2012-333053) EU-Artemis project, co-financed by the ARTEMIS Joint Undertaking and the Hungarian National Research, Development and Innovation Fund. This paper was supported by the János Bolyai Research Scholarship of the Hungarian Academy of Sciences and supported by the ÚNKP-16-4-III. New National Excellence Program of the Ministry of Human Capacities.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by Dr Juha-Pekka Tolvanen.
Rights and permissions
About this article
Cite this article
Kövesdán, G., Lengyel, L. Meta3: a code generator framework for domain-specific languages. Softw Syst Model 18, 2421–2439 (2019). https://doi.org/10.1007/s10270-018-0673-6
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10270-018-0673-6