Program-Transformation.Org: The Program Transformation Wiki

TXL: Tree Transformation Language

Homepage: http://www.txl.ca/

The TreeRewriting language TXL (developed by JamesCordy at Queen's University in Kingston, Canada) supports the definition of transformation rules on first-order terms of a given context-free grammar. Rules not only specify a rewrite, but also the strategy for applying it. Strategies are chosen from a small set of implicit top-down search strategies augmented with explicit scoped application of parameterized subrules in the style of a first-order functional language.

TXL is programming language and rapid prototyping system specifically designed to support the specification and rapid implementation of source analysis and transformation tasks of all kinds. TXL has been used to process over four and a half billion lines of source code in commercial Year 2000 automated maintenance systems, and provides the reverse engineering capabilities of commercial software engineering systems such as Embarcadero Describe(tm).

The TXL language is a hybrid functional / rule-based programming language with unification, implied iteration and deep pattern match. Each TXL program has two components:

  • A description of the structures to be transformed, specified as an EBNF grammar in ambiguous context-free form

  • A rooted set of structural rewriting rules, specified by example using pattern/replacement pairs.

As a programming language TXL is unique in that it is has a pure functional superstructure that provides scoping, abstraction, parameterization and recursion, over Prolog-like structural rewriting rules providing pattern search, unification and implicit iteration. The formal semantics and implementation of TXL are based on formal tree rewriting, but the trees are largely hidden from the user due to the by-example style of rule specification.

CategorySystem | TransformationSystems | Contributions by EelcoVisser JamesCordy