Skip to main content

Stratego: A Language for Program Transformation Based on Rewriting Strategies System Description of Stratego 0.5

  • Conference paper
  • First Online:
Rewriting Techniques and Applications (RTA 2001)

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

Included in the following conference series:

Abstract

Program transformation is used in many areas of software engineering. Examples include compilation, optimization, synthesis, refactoring, migration, normalization and improvement [15]. Rewrite rules are a natural formalism for expressing single program transformations. However, using a standard strategy for normalizing a program with a set of rewrite rules is not adequate for implementing program transformation systems. It may be necessary to apply a rule only in some phase of a transformation, to apply rules in some order, or to apply a rule only to part of a program. These restrictions may be necessary to avoid non-termination or to choose a specific path in a non-con uent rewrite system.

Stratego is a language for the specification of program transformation systems based on the paradigm of rewriting strategies. It supports the separation of strategies from transformation rules, thus allowing careful control over the application of these rules. As a result of this separation, transformation rules are reusable in multiple difierent transformations and generic strategies capturing patterns of control can be described independently of the transformation rules they apply. Such strategies can even be formulated independently of the object language by means of the generic term traversal capabilities of Stratego.

In this short paper I give a description of version 0.5 of the Stratego system, discussing the features of the language (Section 2), the library (Section 3), the compiler (Section 4) and some of the applications that have been built (Section 5). Stratego is available as free software under the GNU General Public License from http://www.stratego-language.org.

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. W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998.

    Google Scholar 

  2. O. S. Bagge, M. Haveraaen, and E. Visser. CodeBoost: A framework for the transformation of C++ programs. Technical report, Universiteit Utrecht, 2000.

    Google Scholar 

  3. P. Borovanský, C. Kirchner, H. Kirchner, P.-E. Moreau, and M. Vittek. Elan: A logical framework based on computational systems. In J. Meseguer, editor, ENTCS, volume 4, 1996. Workshop on Rewriting Logic and Applications 1996.

    Google Scholar 

  4. M. G. J. van den Brand, H. A. de Jong, P. Klint, and P. A. Olivier. Efficient annotated terms. Software—Practice & Experience, 30:259–291, 2000.

    Article  Google Scholar 

  5. M. Clavel and J. Meseguer. Reflection and strategies in rewriting logic. In J. Meseguer, editor, ENTCS, volume 4, 1996. Workshop on Rewriting Logic and its Applications 1996.

    Google Scholar 

  6. M. de Jonge, E. Visser, and J. Visser. XT: A bundle of program transformation tools. In ENTCS, 2001. Language Descriptions, Tools and Applications 2001.

    Google Scholar 

  7. A. Van Deursen, J. Heering, and P. Klint, editors. Language Prototyping, volume 5 of AMAST Series in Computing. World Scientific, Singapore, 1996.

    MATH  Google Scholar 

  8. P. Johann and E. Visser. Warm fusion in Stratego: A case study in the generation of program transformation systems. Annals of Mathematics and Artificial Intelligence. (To appear).

    Google Scholar 

  9. E. Visser. Strategic pattern matching. In P. Narendran and M. Rusinowitch, editors, Rewriting Techniques and Applications (RTA’99), volume 1631 of Lecture Notes in Computer Science, pages 30–44, Trento, Italy, July 1999. Springer-Verlag.

    Google Scholar 

  10. E. Visser. The Stratego Library. Institute of Information and Computing Sciences, Universiteit Utrecht, Utrecht, The Netherlands, 1999.

    Google Scholar 

  11. E. Visser. Language independent traversals for program transformation. In J. Jeuring, editor, Workshop on Generic Programming (WGP2000), Ponte de Lima, Portugal, July 6, 2000. Technical Report UU-CS-2000-19, Universiteit Utrecht.

    Google Scholar 

  12. E. Visser. Tiger in Stratego: An exercise in compilation by transformation. http://www.stratego-language.org/tiger/, 2000.

  13. E. Visser and Z.-e.-A. Benaissa. A core language for rewriting. In C. Kirchner and H. Kirchner, editors, ENTCS, volume 15, September 1998. Rewriting Logic and its Applications 1998.

    Google Scholar 

  14. E. Visser, Z.-e.-A. Benaissa, and A. Tolmach. Building program optimizers with rewriting strategies. ACM SIGPLAN Notices, 34(1):13–26, January 1999. Proceedings of the International Conference on Functional Programming (ICFP’98).

    Article  Google Scholar 

  15. E. Visser et al. The online survey of program transformation. http://www.program-transformation.org/survey.html.

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Visser, E. (2001). Stratego: A Language for Program Transformation Based on Rewriting Strategies System Description of Stratego 0.5. In: Middeldorp, A. (eds) Rewriting Techniques and Applications. RTA 2001. Lecture Notes in Computer Science, vol 2051. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45127-7_27

Download citation

  • DOI: https://doi.org/10.1007/3-540-45127-7_27

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42117-7

  • Online ISBN: 978-3-540-45127-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics