Repository navigation
Language Specification (G) : Generics
Benjamin Kowarsch edited this page Aug 16, 2026
·
1 revision
The Modula-2 Template Engine is a standalone utility for generating source files by placeholder substitution. It reads any text file as input, replaces placeholders found within the input file with their translations supplied as a key/value list via command line interface (CLI) and writes the result into an output file. An input file that contains placeholders is called a template.
Placeholders will be replaced by their translations. They are identified by opening and closing delimiters <# and #>.
placeholder := '<#' identifier `#>';
identifier := Letter ( Letter | Digit )*;INTERFACE MODULE <#TypeIdent#>;Template comments are not copied into the output file. They are identified by opening and closing delimiters /* and */.
templateComment := '/*' ( printableChar | Space | Tab | Newline )* `*/';
printableChar := Letter | Digit | graphicAsciiChar;/* This template generates a stack library interface for arbitrary types. */Any other input will be copied into the output file verbatim.
Copyright © 2015-2018 Modula-2 Software Foundation