skip to main content
10.1145/1621607.1621624acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Generating safe template languages

Published:04 October 2009Publication History

ABSTRACT

Template languages are widely used within generative programming, because they provide intuitive means to generate software artefacts expressed in a specific object language. However, most template languages perform template instantiation on the level of string literals, which allows neither syntax checks nor semantics analysis. To make sure that generated artefacts always conform to the object language, we propose to perform static analysis at template design time. In addition, the increasing popularity of domainspecific languages (DSLs) demands an approach that allows to reuse both the concepts of template languages and the corresponding tools.

In this paper we address the issues mentioned above by presenting how existing languages can be automatically extended with generic template concepts (e.g., placeholders, loops, conditions) to obtain safe template languages. These languages provide means for syntax checking and static semantic analysis w.r.t. the object language at template design time. We discuss the prerequisites for this extension, analyse the types of correctness properties that can be assured at template design time, and exemplify the key benefits of this approach on a textual DSL and Java.

References

  1. Jeroen Arnoldus, Jeanot Bijpost, and Mark van den Brand. Repleo: a Syntax-Safe Template Engine. In Proceedings of the 6th International Conference on Generative Programming and Component Engineering (GPCE 2007), pages 25--32, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-855-8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Gilad Bracha and Gary Lindstrom. Modularity Meets Inheritance. In Proceedings of the 1992 International Conference on Computer Languages, pages 282--290. IEEE Computer Society, 1992.Google ScholarGoogle Scholar
  3. Martin Bravenboer and Eelco Visser. Concrete Syntax for Objects: Domain-Specific Language Embedding and Assimilation without Restrictions. In John M. Vlissides and Douglas C. Schmidt, editors, Proceedings of the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2004), pages 365--383. ACM, October 2004. ISBN 1-58113-831-8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Martin Bravenboer, Rene de Groot, and Eelco Visser. MetaBorg in Action: Examples of Domain-specific Language Embedding and Assimilation using Stratego/XT. In R. Lammel and J. Saraiva, editors, Proceedings of the Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE 2005), volume 4143 of Lecture Notes in Computer Science, pages 297--311, Berlin, Heidelberg, 2006. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Martin Bravenboer, Karl Trygve Kalleberg, Rob Vermaas, and Eelco Visser. Stratego/XT 0.17. A Language and Toolset for Program Transformation. Science of Computer Programming, 72(1-2):52--70, June 2008. ISSN 0167-6423. Special issue on experimental software and toolkits. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Sergey Dmitriev. Language Oriented Programming: The Next Programming Paradigm. White Paper, JetBrains, 2004. URL http://www.onboard.jetbrains.com/is1/articles/04/10/lop.Google ScholarGoogle Scholar
  7. Torbjorn Ekman and Gorel Hedin. Modular name analysis for Java using JastAdd. In R. Lammel and J. Saraiva, editors, Proceedings of the Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE 2005), volume 4143 of Lecture Notes in Computer Science, Berlin, Heidelberg, 2006. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Douglas Gregor, Jaakko Jarvi, Jeremy Siek, Bjarne Stroustrup, Gabriel Dos Reis, and Andrew Lumsdaine. Concepts: linguistic support for generic programming in C++. In Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications (OOPSLA 2006), pages 291--310, New York, NY, USA, 2006. ACM. ISBN 1-59593-348-4. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Falk Hartmann. An Architecture for an XML-Template Engine Enabling Safe Authoring. In Proceedings of the 17th International Workshop on Database and Expert Systems Applications (DEXA 2006), pages 502--507. IEEE Computer Society, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Falk Hartmann. Ensuring the Instantiation Results of XML Templates. In Proceedings of the IADIS International Conference WWW/Internet 2007, 2007.Google ScholarGoogle Scholar
  11. Jan Heering, P.R.H. Hendriks, Paul Klint, and Jan Rekers. The Syntax Definition Formalism SDF"Reference Manual". SIGPLAN Not., 24 (11):43--75, 1989. ISSN 0362-1340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Florian Heidenreich, Jakob Henriksson, Jendrik Johannes, and Steffen Zschaler. On Language-Independent Model Modularisation. Transactions on Aspect-Oriented Development, Special Issue on Aspects and MDE, 2008. To Appear.Google ScholarGoogle Scholar
  13. Florian Heidenreich, Jendrik Johannes, Sven Karol, Mirko Seifert, and ChristianWende. Derivation and Refinement of Textual Syntax for Models, Accepted for publication. In Proceedings of the 5th European Conference on Model-Driven Architecture Foundations and Applications (ECMDA-FA 2009), 2009 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Shan Shan Huang and Yannis Smaragdakis. Expressive and safe static reflection with morphj. SIGPLAN Not., 43(6):79--89, 2008. ISSN 0362-1340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Shan Shan Huang, David Zook, and Yannis Smaragdakis. Statically Safe Program Generation with SafeGen. In Robert Gl¨uck and Michael R. Lowry, editors, Proceedings of the 4th International Conference on Generative Programming and Component Engineering (GPCE 2005), volume 3676 of Lecture Notes in Computer Science, pages 309--326. Springer, 2005. ISBN 3-540-29138-5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Stan Jarzabek, Paul Bassett, Hongyu Zhang, and Weishan Zhang. XVCL: XML-based Variant Configuration Language. Proceedings of the 25th International Conference on Software Engineering (ICSE 2003), pages 810--811, May 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. JetBrains. JetBrains Meta Programming System (MPS), 2009. URL http://www.jetbrains.com/mps.Google ScholarGoogle Scholar
  18. Anneke Kleppe. Software Language Engineering. Pearson Education, 2009. ISBN 0321553454.Google ScholarGoogle Scholar
  19. oAW Project Team. openArchitectureWare, 2009. URL http://www.openArchitectureWare.org.Google ScholarGoogle Scholar
  20. Jon Oldevik. MOFScript Eclipse Plug-In: Metamodel-Based Code Generation. In Eclipse Technology Workshop (EtX) at ECOOP 2006, 2006.Google ScholarGoogle Scholar
  21. OMG. MOF 2.0 core specification. OMG Document, January 2006. URL http://www.omg.org/spec/MOF/2.0. URL http://www.omg.org/spec/MOF/2.0.Google ScholarGoogle Scholar
  22. Terence John Parr. Enforcing Strict Model-View Separation in Template Engines. In Stuart I. Feldman, Mike Uretsky, Marc Najork, and Craig E. Wills, editors, Proceedings of the 13th International Conference on World Wide Web (WWW 2004), pages 224--233. ACM, May 2004. ISBN 1-58113-844-X. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Louis M. Rose, Richard F. Paige, Dimitrios S. Kolovos, and Fiona A. Polack. The Epsilon Generation Language. In Proceedings of the 4th European Conference on Model-Driven Architecture Foundations and Applications (ECMDA-FA 2008), pages 1--16, Berlin, Heidelberg, 2008. Springer. ISBN 978-3-540-69095-5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Daniel A. Sadilek and Guido Wachsmuth. Using Grammarware Languages To Define Operational Semantics of Modelled Languages. In Proceedings of the 47th International Conference Objects, Models, Components, Patterns (TOOLS 2009), volume 33 of Lecture Notes in Business Information Processing, pages 348--356. Springer, 2009. ISBN 978-3-642-02570-9.Google ScholarGoogle Scholar
  25. Antero Taivalsaari. On the Notion of Inheritance. ACM Computing Surveys, 28(3):438--479, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Mark van den Brand, Jan Heering, Hayco de Jong, Merijn de Jonge, Tobias Kuipers, Paul Klint, Leon Moonen, Pieter Olivier, Jeroen Scheerder, Jurgen Vinju, Eelco Visser, and Joost Visser. The ASF+SDF Meta-Environment: a Component-Based Language Development Environment. In Proceedings of the 10th International Conference on Compiler Construction (CC 2001), volume 2027 of Lecture Notes in Computer Science, pages 365--370. Springer, 2001. ISBN 3-540-41861-X. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Eelco Visser. Scannerless Generalized-LR Parsing. Technical Report P9707, Programming Research Group, University of Amsterdam, July 1997a.Google ScholarGoogle Scholar
  28. Eelco Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997b.Google ScholarGoogle Scholar

Index Terms

  1. Generating safe template languages

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      GPCE '09: Proceedings of the eighth international conference on Generative programming and component engineering
      October 2009
      194 pages
      ISBN:9781605584942
      DOI:10.1145/1621607
      • General Chair:
      • Jeremy Siek,
      • Program Chair:
      • Bernd Fischer
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 45, Issue 2
        GPCE '09
        February 2010
        182 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1837852
        Issue’s Table of Contents

      Copyright © 2009 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 4 October 2009

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      GPCE '09 Paper Acceptance Rate18of62submissions,29%Overall Acceptance Rate56of180submissions,31%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader