Support a split operator for each constructor. -- EelcoVisser - 27 Oct 2001

This feature is introduced in StrategoRelease063. -- EelcoVisser - 22 Nov 2001

Term patterns can contain strategy applications.

TermWrap patterns simplify wrapping some complex constructor pattern around a term. For instance, split(f,g) can now be written as

  !(<f>,<g>)
and this generalizes to arbitrary build patterns.

TermProject patterns simplify projection of sub-terms. A strategy application inside a match pattern selects the corresponding sub-term and applies s to it. For example, instead of writing

  A : Typed(Var(x),_) -> x
it is now possible to write
  A = ?Typed(Var(<id>),_)
This feature can also be used to perform tests on subterm in a match pattern, e.g., the pattern
  ?[x | <not([])>]
binds the head of a list to x, checks that the tail is not empty and produces the tail as result.

-- EelcoVisser - 22 Nov 2001


CategoryDone? | LanguageExtensions

Revision: r1.3 - 09 Dec 2001 - 14:41 - EelcoVisser
Stratego > TermWrap
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