Generating safe template languages

Florian Heidenreich, Jendrik Johannes, Mirko Seifert, Christian Wende, Marcel Böhme

Research output: Chapter in Book/Report/Conference proceedingConference PaperResearchpeer-review

7 Citations (Scopus)

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 domain-specific 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.

Original languageEnglish
Title of host publicationGPCE'09 - Proceedings of the 8th International ACM SIGPLAN Conference on Generative Programming and Component Engineering
Pages99-108
Number of pages10
DOIs
Publication statusPublished - 2009
Externally publishedYes
Event8th International ACM SIGPLAN Conference on Generative Programming and Component Engineering, GPCE'09 - Denver, CO, United States of America
Duration: 4 Oct 20095 Oct 2009

Conference

Conference8th International ACM SIGPLAN Conference on Generative Programming and Component Engineering, GPCE'09
CountryUnited States of America
CityDenver, CO
Period4/10/095/10/09

Keywords

  • Generative programming
  • Language extension
  • Safe authoring
  • Template language

Cite this