Skip to main content

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6491))

Abstract

While source transformation systems and languages like DMS, Stratego, ASF + SDF, Rascal and TXL provide a general, powerful base from which to attack a wide range of analysis, transformation and migration problems in the hands of an expert, new users often find it difficult to see how these tools can be applied to their particular kind of problem. The difficulty is not that these very general systems are ill-suited to the solution of the problems, it is that the paradigms for solving them using combinations of the system’s language features are not obvious.

In this paper we attempt to approach this difficulty for the TXL language in a non-traditional way - by introducing the paradigms of use for each kind of problem directly. Rather than simply introducing TXL’s language features, we present them in context as they are required in the paradigms for solving particular classes of problems such as parsing, restructuring, optimization, static analysis and interpretation. In essence this paper presents the beginnings of a “TXL Cookbook” of recipes for effectively using TXL, and to some extent other similar tools, in a range of common source processing and analysis problems. We begin with a short introduction to TXL concepts, then dive right in to some specific problems in parsing, restructuring and static analysis.

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. Barnard, D.T., Holt, R.C.: Hierarchic Syntax Error Repair for LR Grammars. Int. J. Computing and Info. Sci. 11(4), 231–258 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  2. Baxter, I., Pidgeon, P., Mehlich, M.: DMS: Program Transformations for Practical Scalable Software Evolution. In: Proc. Int. Conf. on Software Engineering, pp. 625–634. ACM Press, New York (2004)

    Chapter  Google Scholar 

  3. Bergstra, J.A., Heering, J., Klint, P.: Algebraic Specification. ACM Press, New York (1989)

    MATH  Google Scholar 

  4. Beyer, D.: Relational programming with CrocoPat. In: Proc. Int. Conf. on Software Engineering, pp. 807–810. ACM Press, New York (2006)

    Google Scholar 

  5. van den Brand, M., Klint, P., Vinju, J.J.: Term Rewriting with Traversal Functions. ACM Trans. on Software Eng. and Meth. 12(2), 152–190 (2003)

    Article  MATH  Google Scholar 

  6. Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A Language and Toolset for Program Transformation. Sci. Comput. Program. 72(1-2), 52–70 (2008)

    Article  MathSciNet  Google Scholar 

  7. Cordy, J.R., Dean, T.R., Malton, A.J., Schneider, K.A.: Source Transformation in Software Engineering using the TXL Transformation System. J. Info. and Software Tech. 44(13), 827–837 (2002)

    Article  Google Scholar 

  8. Cordy, J.R.: The TXL Source Transformation Language. Sci. Comput. Program. 61(3), 190–210 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  9. Cordy, J.R.: Source Transformation, Analysis and Generation in TXL. In: Proc. ACM SIGPLAN Works. on Partial Eval. and Program Manip., pp. 1–11. ACM Press, New York (2006)

    Google Scholar 

  10. Cordy, J.R.: The TXL Programming Language, Version 10.5. Queen’s University at Kingston, Canada (2007), http://www.txl.ca/docs/TXL105ProgLang.pdf

  11. Cordy, J.R., Visser, E.: Tiny Imperative Language, http://www.program-transformation.org/Sts/TinyImperativeLanguage

  12. Cordy, J.R.: The TIL Chairmarks, http://www.program-transformation.org/Sts/TILChairmarks

  13. Dean, T.R., Cordy, J.R., Malton, A.J., Schneider, K.A.: Agile Parsing in TXL. J. Automated Softw. Eng. 10(4), 311–336 (2003)

    Article  Google Scholar 

  14. van Deursen, A., Kuipers, T.: Building Documentation Generators. In: Proc. 1999 Int. Conf. on Software Maint., pp. 40–49. IEEE Press, Los Alamitos (1999)

    Google Scholar 

  15. Guo, X., Cordy, J.R., Dean, T.R.: Unique Renaming of Java Using Source Transformation. In: Proc. IEEE Int. Works. on Source Code Analysis and Manip., pp. 151–160. IEEE Press, Los Alamitos (2003)

    Google Scholar 

  16. Holt, R.C.: An introduction to TA: The Tuple-Attribute Language. Technical report, University of Toronto (1997), http://plg.uwaterloo.ca/~holt/papers/ta-intro.htm

  17. Holt, R.C.: Structural Manipulations of Software Architecture using Tarski Relational Algebra. In: Proc. Int. Working Conf. on Reverse Eng., pp. 210–219. IEEE Press, Los Alamitos (1998)

    Google Scholar 

  18. Kamiya, T., Kusumoto, S., Inoue, K.: CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code. IEEE Trans. Software Eng. 28(7), 654–670 (2002)

    Article  Google Scholar 

  19. Moonen, L.: Generating Robust Parsers using Island Grammars. In: Proc. Int. Working Conf. on Reverse Eng., pp. 13–22. IEEE Press, Los Alamitos (2001)

    Chapter  Google Scholar 

  20. Vinju, J., Klint, P., van der Storm, T.: Rascal: a Domain Specific Language for Source Code Analysis and Manipulation. In: Proc. Int. Working Conf. on Source Code Analysis and Manip., pp. 168–177. IEEE Press, Los Alamitos (2009)

    Google Scholar 

  21. Martin, J.: RSF file format. Technical report, University of Victoria (August 1999), http://strategoxt.org/Transform/RigiRSFSpecification

  22. Weiser, M.D.: Program slices: Formal, Psychological, and Practical Investigations of an Automatic Program Abstraction Method. University of Michigan, Ann Arbor (1979)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Cordy, J.R. (2011). Excerpts from the TXL Cookbook. In: Fernandes, J.M., Lämmel, R., Visser, J., Saraiva, J. (eds) Generative and Transformational Techniques in Software Engineering III. GTTSE 2009. Lecture Notes in Computer Science, vol 6491. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-18023-1_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-18023-1_2

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-18022-4

  • Online ISBN: 978-3-642-18023-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics