Refactoring Strategies

Stratego -- Strategies for Program Transformation
Description

The design of Stratego specifications can be improved by ReFactoring. Here is a list of refactorings. Please add to the list if you use missing refactorings.

Refactorings

  • Extract Strategy: take out a sub-expression from a strategy definition and give a name

  • Extract Rule

  • Inline Strategy

  • Inline Rule

  • Rename Label/operator

  • Translate Strategy Into Rule: a strategy of the form ?t1; s1; ...;!t2 can be replaced by a rule

  • Translate Rule Into Strategy: a rule with trivial lhs and rhs, but complex condition is often better expressed as a strategy (pipeline)

  • Extract Module: place a set of rules and strategies in their own module