Abstract
We have developed Tm, a template-based metacompiler. Given a set of data-structure definitions and a template,Tm generates files that instantiate the template for the given data structures. With this process, Tm is able to generate program code to manipulate these data structures. Since it uses templates, the generated code is not restricted to a specific programming language: any sufficiently powerful programming language can be targeted.
Tm has been used for a wide variety of tasks and languages. However, it was designed to support compiler construction, and most applications have been in that area.
In this paper we outlineTm, and describe our experiences with using it to construct a static compiler for Java. As we will show, it has significantly accelerated implementation of the compiler. Almost 75% of its source code is generated by Tm, allowing us to rapidly implement a much more robust and sophisticated compiler than would have been possible otherwise.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
P.F.G. Dechering, J.A. Trescher, J.P.M. de Vreught, and H.J. Sips. V-cal: a calculus for the compilation of data parallel languages. In C.-H. Huang et. al., editor, 8th Intl. Workshop, Languages and Compilers for Parallel Computing, number 1033 in LNCS, pages 388–395, Columbus, Ohio, USA, August 1995. Springer Verlag.
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. DesignPatterns: Elements of Reusable Object-Oriented Software. Addison Wesley, January 1995.
C. van Reeuwijk. Timber download page. www.pds.twi.tudelft.nl/timber/downloading.html.
C. van Reeuwijk. Tm website. www.pds.twi.tudelft.nl/∼reeuwijk/software/Tm.
C. van Reeuwijk. Tm: a code generator for recursive data structures. Software-Practice and Experience, 22(10):899–908, October 1992.
C. van Reeuwijk. Template manager reference manual. PDS Technical Report PDS-2000-003, Delft University of Technology, May 2000. www.pds.twi.tudelft.nl/reports/2000/PDS-2000-003.
C. van Reeuwijk. The Vnus language specification, version 2.1. PDS Technical Report PDS-2000-002, Delft University of Technology, May 2000. www.pds.twi.tudelft.nl/reports/2000/PDS-2000-002.
C. van Reeuwijk, A. van Gemund, and H.J. Sips. Spar: A programming language for semi-automatic compilation of parallel programs. Concurrency-Practice and Experience, 11(9):1193–1205, November 1997.
C. van Reeuwijk, F. Kuijlman, and H.J. Sips. Spar: a set of extensions of Java for scientific computation. Concurrency and Computation: Practice and Experience, accepted for publication.
Edward D. Willink. Meta-Compilation for C++. PhD thesis, Computer Science Research Group, University of Surrey, UK, June 2001.
Edward D. Willink and Vyacheslav B. Muchnick. An object-oriented preprocessor fit for C++. IEE Proceedings-Software, 147:49–58, April 2000.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
van Reeuwijk, C. (2003). Rapid and Robust Compiler Construction Using Template-Based Metacompilation. In: Hedin, G. (eds) Compiler Construction. CC 2003. Lecture Notes in Computer Science, vol 2622. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36579-6_18
Download citation
DOI: https://doi.org/10.1007/3-540-36579-6_18
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-00904-7
Online ISBN: 978-3-540-36579-2
eBook Packages: Springer Book Archive