Abstract
Meta programs manipulate structured representations, i.e., abstract syntax trees, of programs. The conceptual distance between the concrete syntax meta-programmers use to reason about programs and the notation for abstract syntax manipulation provided by general purpose (meta-) programming languages is too great for many applications. In this paper it is shown how the syntax definition formalism SDF can be employed to fit any meta-programming language with concrete syntax notation for composing and analyzing object programs. As a case study, the addition of concrete syntax to the program transformation language Stratego is presented. The approach is then generalized to arbitrary meta-languages.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
A. Aasa. User Defined Syntax. PhD thesis, Dept. of Computer Sciences, Chalmers University of Technology and University of Göteborg, Göteborg, Sweden, 1992.
A. W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998.
D. Batory, B. Lofaso, and Y. Smaragdakis. JTS: A tool suite for building gen-voca generators. In 5th International Conference in Software Reuse, (ICSR’98), Victoria, Canada, June 1998.
J. A. Bergstra, J. Heering, and P. Klint, editors. Algebraic Specification. ACM Press Frontier Series. The ACM Press in co-operation with Addison-Wesley, 1989.
C. Brabrand and M. I. Schwartzbach. Growing languages with metamorphic syntax macros. In PEPM’02, 2002.
M. G. J. van den Brand, H. de Jong, P. Klint, and P. Olivier. Efficient annotated terms. Software, Practice & Experience, 30(3):259–291, 2000.
M. G. J. van den Brand, J. Heering, H. de Jong, M. de Jonge, T. Kuipers, P. Klint, L. Moonen, P. Olivier, J. Scheerder, J. Vinju, E. Visser, and J. Visser. The Asf+Sdf Meta-Environment: a component-based language laboratory. In R. Wilhelm, editor, Compiler Construction (CC’01), volume 2027 of Lecture Notes in Computer Science, pages 365–368, Genova, Italy, April 2001. Springer-Verlag.
M. G. J. van den Brand, J. Scheerder, J. Vinju, and E. Visser. Disambiguation filters for scannerless generalized LR parsers. In N. Horspool, editor, Compiler Construction (CC’02), volume 2304 of Lecture Notes in Computer Science, pages 143–158, Grenoble, France, April 2002. Springer-Verlag.
M. G. J. van den Brand and E. Visser. Generation of formatters for context-free languages. ACM Transactions on Software Engineering and Methodology, 5(1):1–41, January 1996.
R. D. Cameron and M. R. Ito. Grammar-based definition of metaprogramming systems. ACM Trans. on Programming Languages and Systems, 6(1):20–54, 1984.
L. Cardelli, F. Matthes, and M. Abadi. Extensible syntax with lexical scoping. SRC Research Report 121, Digital Systems Research Center, Palo Alto, California, February 1994.
J. R. Cordy, C. D. Halpern, and E. Promislow. TXL: a rapid prototyping system for programming language dialects. In Proc. IEEE 1988 Int. Conf. on Computer Languages, pages 280–285, 1988.
A. van Deursen, J. Heering, and P. Klint, editors. Language Prototyping. An Algebraic Specification Approach, volume 5 of AMAST Series in Computing. World Scientific, Singapore, September 1996.
J. Heering, P. R. H. Hendriks, P. Klint, and J. Rekers. The syntax definition formalism SDF-reference manual. SIGPLAN Notices, 24(11):43–75, 1989.
M. de Jonge, E. Visser, and J. Visser. XT: A bundle of program transformation tools. In M. G. J. van den Brand and D. Perigot, editors, Workshop on Language Descriptions, Tools and Applications (LDTA’01), volume 44 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, April 2001.
P. Klint. A meta-environment for generating programming environments. ACM Transactions on Software Engineering and Methodology, 2(2):176–201, 1993.
M. Mauny and D. de Rauglaudre. A complete and realistic implementation of quotations in ML. In Proc. 1994 Workshop on ML and its applications, pages 70–78. Research report 2265, INRIA, 1994.
S. Peyton Jones, A. Tolmach, and T. Hoare. Playing by the rules: rewriting as a practical optimisation technique in GHC. In R. Hinze, editor, 2001 Haskell Workshop, Firenze, Italy, September 2001. ACM SIGPLAN.
W. Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, 1999.
E. Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997.
E. Visser. Stratego: A language for program transformation based on rewriting strategies. System description of Stratego 0.5. In A. Middeldorp, editor, Rewriting Techniques and Applications (RTA’ 01), volume 2051 of Lecture Notes in Computer Science, pages 357–361. Springer-Verlag, May 2001.
E. Visser, Z.-e.-A. Benaissa, and A. Tolmach. Building program optimizers with rewriting strategies. In Proc. of the third ACM SIGPLAN International Conference on Functional Programming (ICFP’98), pages 13–26. ACM Press, September 1998.
D. Weise and R. F. Crew. Programmable syntax macros. In Proceedings of the ACM SIGPLAN’ 93 Conference on Programming Language Design and Implementation (PLDI’93), Albuquerque, New Mexico, June 1993.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Visser, E. (2002). Meta-programming with Concrete Object Syntax. In: Batory, D., Consel, C., Taha, W. (eds) Generative Programming and Component Engineering. GPCE 2002. Lecture Notes in Computer Science, vol 2487. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45821-2_19
Download citation
DOI: https://doi.org/10.1007/3-540-45821-2_19
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-44284-4
Online ISBN: 978-3-540-45821-0
eBook Packages: Springer Book Archive