Skip to main content

Meta-programming with Concrete Object Syntax

  • Conference paper
  • First Online:
Generative Programming and Component Engineering (GPCE 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2487))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A. Aasa. User Defined Syntax. PhD thesis, Dept. of Computer Sciences, Chalmers University of Technology and University of Göteborg, Göteborg, Sweden, 1992.

    Google Scholar 

  2. A. W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. 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.

    Google Scholar 

  5. C. Brabrand and M. I. Schwartzbach. Growing languages with metamorphic syntax macros. In PEPM’02, 2002.

    Google Scholar 

  6. 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.

    Article  Google Scholar 

  7. 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.

    Chapter  Google Scholar 

  8. 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.

    Chapter  Google Scholar 

  9. 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.

    Google Scholar 

  10. 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.

    Article  MATH  Google Scholar 

  11. 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.

    Google Scholar 

  12. 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.

    Google Scholar 

  13. 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.

    MATH  Google Scholar 

  14. 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.

    Article  Google Scholar 

  15. 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.

    Google Scholar 

  16. P. Klint. A meta-environment for generating programming environments. ACM Transactions on Software Engineering and Methodology, 2(2):176–201, 1993.

    Article  Google Scholar 

  17. 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.

    Google Scholar 

  18. 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.

    Google Scholar 

  19. W. Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, 1999.

    Google Scholar 

  20. E. Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997.

    Google Scholar 

  21. 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.

    Chapter  Google Scholar 

  22. 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.

    Google Scholar 

  23. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics