Stratego/XT

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
Stratego/XT
File:Stratego Logo.png
Stable release 0.17 / July 8, 2009
Operating system GNU/Linux, Unix, Mac OS X, Windows
Type program transformation system
License LGPLv2+[1]
Website http://www.strategoxt.org

Stratego/XT is a language and toolset for constructing stand-alone program transformation systems. It combines the Stratego transformation language with the XT toolset of transformation components, providing a framework for constructing stand-alone program transformation systems. The Stratego language is based on a programming paradigm called strategic term rewriting. It provides rewrite rules for expressing basic transformation steps. The application of these rules can be controlled using strategies, a form of subroutines. The XT toolset provides reusable transformation components and declarative languages for deriving new components, such as parsing grammars using the Modular Syntax Definition Formalism (SDF) and implementing pretty-printing.

Concrete syntax

Program transformations often operate by modifying the abstract syntax tree (AST). In Stratego it is also possible to specify transformations using concrete syntax.[2] This allows programmers to express a transformation using the familiar (and often more concise) syntax of the object programming language, while it internally still operates on the AST.

Examples

A rule to desugar a do-while statement in Java:[3]

desugar : While(e, stm) -> If(e, DoWhile(stm, e))

The same rule, using concrete syntax:

desugar : |[ while (e) stm; ]| -> |[ if (e) do stm while(e); ]|

See also

History

The theoretical framework for Stratego, called System S, was first described in a paper [4] by Eelco Visser and Zine-el-Abidine Benaissa.

Notes

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Meta-programming with concrete object syntax
  3. Using the Java-front syntax definition
  4. Lua error in package.lua at line 80: module 'strict' not found.

External links