Skip to main content
Log in

Meta3: a code generator framework for domain-specific languages

  • Regular Paper
  • Published:
Software & Systems Modeling Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

Notes

  1. 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.

  2. https://github.com/gaborbsd/ProtoKit

  3. https://github.com/gaborbsd/ProtoKit2

  4. https://github.com/FTSRG/concerto

References

  1. Fowler, M.: Domain-Specific Languages. Addison-Wesley, Boston (2010)

    Google Scholar 

  2. Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison-Wesley, Boston (2006)

    MATH  Google Scholar 

  3. Bettini, L.: Implementing Domain-Specific Languages with Xtext and Xtend. Packt Publishing, Birmingham (2013)

    Google Scholar 

  4. 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)

  5. 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)

  6. Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF: Eclipse Modeling Framework, 2nd edn. Addison-Wesley Professional, Boston (2008)

    Google Scholar 

  7. Parr, T.: The Definitive ANTLR 4 Reference, 2nd edn. Pragmatic Bookshelf, Dallas (2013)

    Google Scholar 

  8. Kövesdán, G., Asztalos, M., Lengyel, L.: Polymorphic templates. In: XM 2014 Extreme Modeling Workshop, in Conjunction with MODELS 2014 (2014)

  9. Voelter, M.: Jenerator-generative programming for Java. In: Workshop on Generative Programming, OOPSLA (2001)

  10. Sugar4j Website. http://sugar4j.sourceforge.net/index.html. Accessed 27 Mar 2018

  11. 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)

  12. 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)

  13. Frankel, D.S.: Model Driven Architecture: Applying MDA to Enterprise Computing. Wiley, New York (2003)

    Google Scholar 

  14. 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)

    Article  Google Scholar 

  15. Kelly, S., Tolvanen, J.-P.: Domain-Specific Modeling: Enabling Full Code Generation. Wiley-IEEE Computer Society, New York (2008)

    Book  Google Scholar 

  16. 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)

    Book  Google Scholar 

  17. 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)

  18. 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)

  19. 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

  20. 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)

    Google Scholar 

  21. 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)

    Article  MathSciNet  Google Scholar 

  22. Visser, E.: Declare your own language. Online book. https://github.com/MetaBorgCube/declare-your-language. Accessed 27 Mar 2018

  23. 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

    Google Scholar 

  24. Eclipse Graphiti Website. https://www.eclipse.org/graphiti/. Accessed 27 Mar 2018

  25. The Meta Programming System Website. https://www.jetbrains.com/mps/. Accessed 27 Mar 2018

  26. MetaEdit+ Website. http://www.metacase.com/mwb/. Accessed 27 Mar 2018

  27. The Visual Modeling and Transformation System Website. https://www.aut.bme.hu/Pages/Research/VMTS/Introduction. Accessed 27 Mar 2018

  28. DMS Software Reengineering Toolkit Website. http://www.semdesigns.com/Products/DMS/DMSToolkit.html. Accessed 27 Mar 2018

  29. Ensō Website. http://enso-lang.org/. Accessed 27 Mar 2018

  30. Rascal Website. http://www.rascal-mpl.org/. Accessed 27 Mar 2018

  31. AnyDSL Website. https://anydsl.github.io/. Accessed 27 Mar 2018

Download references

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

Authors

Corresponding author

Correspondence to Gábor Kövesdán.

Additional information

Communicated by Dr Juha-Pekka Tolvanen.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10270-018-0673-6

Keywords

Navigation