Switching Rules On With Dynamic Rules
Stratego -- Strategies for Program Transformation
The
dynamic rules mechanism can be used to enable a set of rules.
TriggerRules =
?Context(Bla, _);
rules( A : ... -> ... B : ... -> ... )
traverse =
rec x({| A, B : try(TriggerRules + A + B); all(x) |})
Rules
A
and
B
are only applied after a
Context(Bla,...)
has been encountered.
This is not always appropriate. Often the applicability of rules can be determined by the position in
the tree.
--
EelcoVisser & Lennart Swart - 22 May 2002