MontiCore: a framework for compositional development of domain specific languages

Regular Paper

Abstract

Domain specific languages (DSLs) are increasingly used today. Coping with complex language definitions, evolving them in a structured way, and ensuring their error freeness are the main challenges of DSL design and implementation. The use of modular language definitions and composition operators are therefore inevitable in the independent development of language components. In this article, we discuss these arising issues by describing a framework for the compositional development of textual DSLs and their supporting tools. We use a redundance-free definition of a readable concrete syntax and a comprehensible abstract syntax as both representations significantly overlap in their structure. For enhancing the usability of the abstract syntax, we added concepts like associations and inheritance to a grammar-based definition in order to build up arbitrary graphs (as known from metamodeling). Two modularity concepts, grammar inheritance and embedding, are discussed. They permit compositional language definition and thus simplify the extension of languages based on already existing ones. We demonstrate that compositional engineering of new languages is a useful concept when project-individual DSLs with appropriate tool support are defined.

Keywords

Domain specific language Grammarware Composition 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Bass L., Clements P., Kazman R.: Software Architecture in Pratice. Addison-Wesley, New York (2003)Google Scholar
  2. 2.
    van den Brand, M., Heering, J., van Deursen, A., de Jong, H., de Jonge, M., Kuipers, T., Klint, P., Moonen, L., Olivier, P., Scheerder, J., Vinju, J., Visser, E., Visser, J.: The ASF+SDF meta-environment: a component-based language development environment. In: Proceedings of Compiler Construction (CC) 2001, number 2102 in LNCS. Springer, Heidelberg (2001)Google Scholar
  3. 3.
    Van Den Brand, M., Sellink, A., Verhoef, C.: Current parsing techniques in software renovation considered harmful. In: Proceedings of the Sixth International Workshop on Program Comprehension, pp. 108–117. IEEE Computer Society, New York (1998)Google Scholar
  4. 4.
    Bravenboer, M., de Groot, R., Visser, E.: MetaBorg in action: examples of domain-specific language embedding and assimilation using Stratego/XT. In: Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE’05), Braga, Portugal, July 2005Google Scholar
  5. 5.
    Bravenboer, M., Visser, E.: Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions. In: Proceedings of International Conference on Object Oriented Programming, Systems, Languages and Applications (OOPSLA) 2004. ACM, New York (2004)Google Scholar
  6. 6.
    Bravenboer, M., Visser, E.: Designing syntax embeddings and assimilations for language libraries. In: 4th International Workshop on Software Language Engineering (2007)Google Scholar
  7. 7.
    Budinsky F., Steinberg D., Ed Merks E., Ellersick R., Grose T.J.: Eclipse Modeling Framework. Addison-Wesley, New York (2003)Google Scholar
  8. 8.
    Büttner, F., Radfelder, O., Lindow, A., Gogolla, M.: Digging into the visitor pattern. In: Proceedings of International Conference on Software Engineering & Knowledge Engineering (SEKE) 2004. IEEE Computer Society Press, New York (2004)Google Scholar
  9. 9.
    Czarnecki K., Eisenecker U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, New York (2000)Google Scholar
  10. 10.
    Dodd, C., Maslov, V.: BTYACC—backtracking YACC, 2006. http://www.siber.com/btyacc/
  11. 11.
    Earley J.: An efficient context-free parsing algorithm. Commun. ACM 13(2), 94–102 (1970)MATHCrossRefGoogle Scholar
  12. 12.
    Eclipse Website http://www.eclipse.org
  13. 13.
    Ekman, T., Hedin, G.: The jastadd extensible java compiler. SIGPLAN Notices. In: Proceedings of the 2007 OOPSLA Conference, vol. 42(10), pp. 1–18 (2007)Google Scholar
  14. 14.
    Ekman T., Hedin G.: The JastAdd system—modular extensible compiler construction. Sci. Programm. 69(1–3), 14–26 (2007)MATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Fondement, F., Schnekenburger, R., Gerard, S., Muller, P.-A.: Metamodel-Aware Textual Concrete Syntax Specification. Technical Report LGL-REPORT-2006-005, Swiss Federal Institute of Technology, December (2006)Google Scholar
  16. 16.
    Ford, B.: Packrat parsing: simple, powerful, lazy, linear time. In: Proceedings of the International Conference on Functional Programming (ICFP) 2002. ACM, New York (2002)Google Scholar
  17. 17.
    Gagnon, E., Hendren, L.: SableCC—an object-oriented compiler framework. In: Proceedings of TOOLS (1998)Google Scholar
  18. 18.
    Gamma E., Beck K.: Contributing to Eclipse: Principles, Patterns, and Plugins. Addison Wesley Longman, Redwood City (2003)Google Scholar
  19. 19.
    Gamma E., Helm R., Johnson R., Vlissides J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Professional, New York (1995)Google Scholar
  20. 20.
    Gosling J., Joy B., Steele G.L.: The Java Language Specification, 3rd edn. Addison-Wesley, New York (2005)Google Scholar
  21. 21.
    Grimm, R.: Better extensibility through modular syntax. In: PLDI ’06: Proceedings of the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 38–51. ACM, New York (2006)Google Scholar
  22. 22.
    Grönniger, H., Krahn, H., Rumpe, B., Schindler, M.: Integration von Modellen in einen codebasierten Softwareentwicklungsprozess. In: Proceedings of Modellierung 2006 (LNI P-82) (2006)Google Scholar
  23. 23.
    Grönniger, H., Krahn, H., Rumpe, B., Schindler, M., Völkel, S.: MontiCore 1.0—E. In: Framework zur Erstellung und Verarbeitung domänenspezifischer Sprachen. Technical Report Informatik-Bericht 2006-04, Software Systems Engineering Institute, Braunschweig University of Technology (2006)Google Scholar
  24. 24.
    Grönniger, H., Krahn, H., Rumpe, B., Schindler, M., Völkel, S.: Textbased modeling. In: 4th International Workshop on Software Language Engineering (2007)Google Scholar
  25. 25.
    Grönniger, H., Krahn, H., Rumpe, B., Schindler, M., Völkel, S.: Monticore: a framework for the development of textual domain specific languages. In: 30th International Conference on Software Engineering (ICSE 2008), Leipzig, Germany, 10–18 May 2008, companion volume, pp 925–926 (2008)Google Scholar
  26. 26.
    Harel D., Rumpe B.: Meaningful modeling: what’s the semantics of “semantics”?. Computer 37(10), 64–72 (2004)CrossRefGoogle Scholar
  27. 27.
    Hedin, G.: Reference attributed grammars. In: Parigot, D., Mernik, M. (eds.) Second Workshop on Attribute Grammars and their Applications, WAGA’99, pp. 153–172. Amsterdam, The Netherlands (1999) (INRIA rocquencourt)Google Scholar
  28. 28.
    Heering J., Hendriks P.R.H., Klint P., Rekers J.: The syntax definition formalism SDF—reference manual. Sigplan Not. 24(11), 43–75 (1989)CrossRefGoogle Scholar
  29. 29.
    Herrmann, C., Krahn, H., Rumpe, B., Schindler, M., Völkel, S.: An algebraic view on the semantics of model composition. In: Akehurst, D.H., Vogel, R., Paige, R.F. (eds.) Model Driven Architecture—Foundations and Applications (ECMDA-FA), Number 4530 in LNCS, pp. 99–113, Haifa, Israel, June 2007. Springer, HeidelbergGoogle Scholar
  30. 30.
    Hoare, C.A.R.: Hints on Programming Language Design. Technical report. Stanford University, Stanford (1973)Google Scholar
  31. 31.
    Jouault, F., Bezivin, J.: KM3: a DSL for metamodel specification. In: Proceedings of 8th IFIP International Conference on Formal Methods for Open Object-Based Distributed Systems (LNCS 4037), pp. 171–185 (2006)Google Scholar
  32. 32.
    Jouault, F., Bezivin, J., Kurtev, I.: TCS: a DSL for the specification of textual concrete syntaxes in model engineering. In: Proceedings of the Fifth International Conference on Generative Programming and Component Engineering (2006)Google Scholar
  33. 33.
    Kadhim, B.M., Waite, W.M.: Maptool—supporting modular syntax development. In: CC ’96: Proceedings of the 6th International Conference on Compiler Construction, pp. 268–280, London, UK. Springer, Heidelberg (1996)Google Scholar
  34. 34.
    Klint P., Lämmel R., Verhoef C.: Toward an engineering discipline for grammarware. ACM Trans. Softw. Eng. Meth. 14(3), 331–380 (2005)CrossRefGoogle Scholar
  35. 35.
    Knuth D.F.: Semantics of context-free languages. Math. Syst. Theory 12, 127–145 (1968)CrossRefMathSciNetGoogle Scholar
  36. 36.
    Kort, J., Lämmel, R., Verhoef, C.: The grammar deployment kit. In: Electronic Notes in Theoretical Computer Science, vol. 65. Elsevier, Amsterdam (2002)Google Scholar
  37. 37.
    Krahn, H., Rumpe, B.: Techniques For Lightweight Generator Refactoring. In: Proceedings of Summer School on Generative and Transformational Techniques in Software Engineering (LNCS 4143). Springer, Heidelberg (2006)Google Scholar
  38. 38.
    Krahn, H., Rumpe, B., Völkel, S.: Efficient editor generation for compositional DSLs in eclipse. In: Proceedings of the 7th OOPSLA Workshop on Domain-Specific Modeling (2007)Google Scholar
  39. 39.
    Krahn, H., Rumpe, B., Völkel, S.: Integrated definition of abstract and concrete syntax for textual languages. In: Proceedings of Models 2007, pp. 286–300 (2007)Google Scholar
  40. 40.
    Krahn H., Rumpe B., Völkel S.: Mit sprachbaukästen zur schnelleren softwareentwicklung: Domänenspezifische sprachen modular entwickeln. Objektspektrum 4, 42–47 (2008)Google Scholar
  41. 41.
    Krahn, H., Rumpe, B., Völkel, S.: Monticore: modular development of textual domain specific languages. In: Proceedings of Tools Europe (2008)Google Scholar
  42. 42.
    Lämmel, R.: Grammar adaptation. In: Proceedings of Formal Methods Europe (FME) 2001 (LNCS 2021), pp. 550–570. Springer, Heidelberg (2001)Google Scholar
  43. 43.
    Lämmel, R., Jones, S.P.: Scrap your boilerplate: a practical design pattern for generic programming. In: Proceedings of Workshop on Types in Language Design and Implementation (TLDI 2003) (2003)Google Scholar
  44. 44.
    Lämmel, R., Meijer, E., Revealing the X/O impedance mismatch (Changing lead into gold). In: Datatype-Generic Programming. Springer, Heidelberg (2007)Google Scholar
  45. 45.
    Ledeczi, A., Maroti, M., Bakay, A., Karsai, G., Garrett, J., Thomason, C., Nordstrom, G., Sprinkle, J., Volgyesi, P.: The generic modeling environment. In: International Workshop on Intelligent Signal Processing (WISP). IEEE, New York (2001)Google Scholar
  46. 46.
    Meijer, E., Beckman, B., Bierman, G.: Linq: reconciling object, relations and xml in the net framework. In: SIGMOD ’06: Proceedings of the 2006 ACM SIGMOD international conference on Management of data, pp. 706–706. ACM, New York (2006)Google Scholar
  47. 47.
    Mernik, M., Lenič, M., Avdičaušević, E., Žumer, V.: Multiple attribute grammar inheritance. In: Parigot, D., Mernik, M. (eds.) Second Workshop on Attribute Grammars and their Applications, WAGA’99, pp. 57–76. Amsterdam, The Netherlands (1999) (INRIA rocquencourt)Google Scholar
  48. 48.
    Marjan M., Žumer V., Lenič M., Avdičaušević E.: Implementation of multiple attribute grammar inheritance in the tool LISA. SIGPLAN Not. 34(6), 68–75 (1999)CrossRefGoogle Scholar
  49. 49.
    MontiCore Website http://www.monticore.de
  50. 50.
    Muller, P.-A., Fleurey, F., Fondement, F., Hassenforder, M., Schneckenburger, R., Gérard, S., Jézéquel, J.-M.: Model-driven analysis and synthesis of concrete syntax. In: Proceedings of MoDELS 2006 (LNCS 4199), pp. 98–110 (2006)Google Scholar
  51. 51.
    Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: an extensible compiler framework for Java. In: Proceedings of the International Conference on Compiler Construction (CC) 2003, number 2622 in LNCS. Springer, Heidelberg (2003)Google Scholar
  52. 52.
    Object Management Group. Unified Modeling Language: Superstructure Version 2.1.2 (07-11-02) (2007). http://www.omg.org/docs/formal/07-11-02.pdf
  53. 53.
    OpenArchitectureWare Website http://www.openarchitectureware.com/
  54. 54.
    Palsberg, J., Jay, C.B.: The essence of the visitor pattern. In: Proceedings of the 22nd IEEE Int. Computer Software and Applications Conf., COMPSAC, Vienna, Austria, August, pp. 9–15. IEEE, Los Alamitos (1998)Google Scholar
  55. 55.
    Parnas D.L.: On the criteria to be used in decomposing systems into modules. Commun. ACM 15(12), 1053–1058 (1972)CrossRefGoogle Scholar
  56. 56.
    Parr, T.: The Definitive ANTLR Reference: Building Domain-Specific Languages. Pragmatic Programmers, 1st edn. Pragmatic Bookshelf, Raleigh (2007)Google Scholar
  57. 57.
    Parr T., Quong R.: ANTLR: A predicated-LL(k) parser generator. J. Softw. Prac. Exp. 25(7), 789–810 (1995)CrossRefGoogle Scholar
  58. 58.
    Rumpe B.: Agile Modellierung mit UML: Codegenerierung, Testfälle, Refactoring. Springer, Heidelberg (2004)Google Scholar
  59. 59.
    Rumpe B.: Modellierung mit UML. Springer, Heidelberg (2004)MATHGoogle Scholar
  60. 60.
    Simons A.J.H.: The theory of classification, part 17: multiple inheritance and the resolution of inheritance conflicts. J. Object Tech. 4(2), 15–26 (2005)Google Scholar
  61. 61.
    The Eclipse IDE Meta-tooling Platform Website. http://eclipse-imp.sourceforge.net/
  62. 62.
    Tomita M.: Efficient Parsing for Natural Languages. A Fast Algorithm for Practical Systems. Kluwer, Dordrecht (1985)Google Scholar
  63. 63.
    Van Wyk, E., Krishnan, L., Schwerdfeger, A., Bodin, D.: Attribute grammar-based language extensions for java. In: European Conference on Object Oriented Programming (ECOOP), Lecture Notes in Computer Science, vol. 4609, July. Springer, Heidelberg (2007)Google Scholar
  64. 64.
    Velocity Website http://velocity.apache.org/
  65. 65.
    Visser, E.: Scannerless Generalized-lr Parsing. Technical Report, University of Amsterdam (1997)Google Scholar
  66. 66.
    Visser, J.: Visitor combination and traversal control. In: OOPSLA ’01: Proceedings of the 16th ACM SIGPLAN conference on Object Oriented Programming, Systems, Languages, and Applications, pp. 270–282. ACM, New York (2001)Google Scholar
  67. 67.
    Visser, J., Generic Traversal over Typed Source Code Representations. Ph.D. thesis, University of Amsterdam, February (2003)Google Scholar
  68. 68.
    Wile, D.S.: Abstract syntax from concrete syntax. In: ICSE ’97: Proceedings of the 19th International Conference on Software Engineering, pp. 472–480, New York, NY, USA. ACM, New York (1997)Google Scholar
  69. 69.
    Van Wyk, E.R., Schwerdfeger, A.C.: Context-aware scanning for parsing extensible languages. In: GPCE ’07: Proceedings of the 6th International Conference on Generative Programming and Component Engineering, pp. 63–72, New York, NY, USA. ACM, New York (2007)Google Scholar
  70. 70.
    van Wyk, E., de Moor, O., Backhouse, K., Kwiatkowski, P.: Forwarding in Attribute Grammars for Modular Language Design. In: Proceedings of the 11th International Conference on Compiler Construction 2002, pp. 128–142, London, UK. Springer, Heidelberg (2002)Google Scholar

Copyright information

© Springer-Verlag 2010

Authors and Affiliations

  1. 1.Software Engineering Group, Department of Computer Science 3RWTH Aachen UniversityAachenGermany

Personalised recommendations