The worker-wrapper component of the Stratego optimizer splits strategy definitions into a wrapper performing a pattern match, and a worker doing the real work of the operator. That is, a definition of the form
  f(as1 | as2) = {xs : ?t ; s}
is split into the pair of definitions
  f(as1 | as2) = {xs : ?t ; g(as1 | as2, xs)}
  g(as1 | as2, xs) = s
Thus f is reduced to a small definition comprising only a match and a call to the continuation g. The smaller definition for f becomes attractive to inline, especially in the context of a choice where pattern match compilation may integrate it with other matches, or in the context of a build, which may cancel against the match ?t.

-- EelcoVisser - 17 Aug 2003

Revision: r1.1 - 17 Aug 2003 - 12:50 - EelcoVisser
Stratego > StrategoCompiler > StrategoOptimizer > WorkerWrapperSplitting
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