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.
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Falk Hartmann. Ensuring the Instantiation Results of XML Templates. In Proceedings of the IADIS International Conference WWW/Internet 2007, 2007.Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- Shan Shan Huang and Yannis Smaragdakis. Expressive and safe static reflection with morphj. SIGPLAN Not., 43(6):79--89, 2008. ISSN 0362-1340. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- JetBrains. JetBrains Meta Programming System (MPS), 2009. URL http://www.jetbrains.com/mps.Google Scholar
- Anneke Kleppe. Software Language Engineering. Pearson Education, 2009. ISBN 0321553454.Google Scholar
- oAW Project Team. openArchitectureWare, 2009. URL http://www.openArchitectureWare.org.Google Scholar
- Jon Oldevik. MOFScript Eclipse Plug-In: Metamodel-Based Code Generation. In Eclipse Technology Workshop (EtX) at ECOOP 2006, 2006.Google Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- Antero Taivalsaari. On the Notion of Inheritance. ACM Computing Surveys, 28(3):438--479, 1996. Google ScholarDigital Library
- 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 ScholarDigital Library
- Eelco Visser. Scannerless Generalized-LR Parsing. Technical Report P9707, Programming Research Group, University of Amsterdam, July 1997a.Google Scholar
- Eelco Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997b.Google Scholar
Index Terms
- Generating safe template languages
Recommendations
Generating safe template languages
GPCE '09Template 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 ...
Layout-sensitive language extensibility with SugarHaskell
Haskell '12: Proceedings of the 2012 Haskell SymposiumProgrammers need convenient syntax to write elegant and concise programs. Consequently, the Haskell standard provides syntactic sugar for some scenarios (e.g., do notation for monadic code), authors of Haskell compilers provide syntactic sugar for more ...
Layout-sensitive language extensibility with SugarHaskell
Haskell '12Programmers need convenient syntax to write elegant and concise programs. Consequently, the Haskell standard provides syntactic sugar for some scenarios (e.g., do notation for monadic code), authors of Haskell compilers provide syntactic sugar for more ...
Comments