Generating safe template languages
2009
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.
Keywords:
- Computer science
- Theoretical computer science
- Generic programming
- Fourth-generation programming language
- Programming language
- Second-generation programming language
- Object language
- Comparison of multi-paradigm programming languages
- String literal
- Fifth-generation programming language
- Third-generation programming language
- Semantics
- Artificial intelligence
- Natural language processing
- Correction
- Source
- Cite
- Save
- Machine Reading By IdeaReader
22
References
13
Citations
NaN
KQI