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

Revision: r1.1 - 22 May 2002 - 14:41 - EelcoVisser
Stratego > StrategoIdiom > SwitchingRulesOnWithDynamicRules
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback