Excerpts from the TXL Cookbook
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.
Keywordssource transformation source analysis TXL coding paradigms
Unable to display preview. Download preview PDF.
- 4.Beyer, D.: Relational programming with CrocoPat. In: Proc. Int. Conf. on Software Engineering, pp. 807–810. ACM Press, New York (2006)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
- 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
- 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