Peter Fritzson
PELAB – Programming Environment Lab, Dept. Computer Science, Linköping University, Sweden
Pavol Privitzer
Institute of Pathological Physiology, First Faculty of Medicine, University in Prague, Chezh Republic
Martin Sjölund
PELAB – Programming Environment Lab, Dept. Computer Science, Linköping University, Sweden
Adrian Pop
PELAB – Programming Environment Lab, Dept. Computer Science, Linköping University, Sweden
Download articlehttp://dx.doi.org/10.3384/ecp09430124Published in: Proceedings of the 7th International Modelica Conference; Como; Italy; 20-22 September 2009
Linköping Electronic Conference Proceedings 43:21, p. 193-207
Published: 2009-12-29
ISBN: 978-91-7393-513-5
ISSN: 1650-3686 (print), 1650-3740 (online)
The uses; needs; and requirements of a text generation template language for Modelica are discussed. A template language may allow more concise and readable programming of the generation of textual models; program code; or documents; from a structured model representation such as abstract syntax trees (AST). Applications can be found in generating simulation code in other programming languages from models; generation of specialized models for various applications; generation of documentation; web pages; etc. We present several template language designs and some usage examples; both C code generation and Modelica model generation. Implementation is done in the OpenModelica environment. Two designs are currently operational.
Template language; unparsing; pretty printing; code generation; Modelica.