I'm very interested in seeing alternative approaches to tree transformation, however, they have yet to arrive (and we actually have an ongoing investigation in this direction).
To get things done in the meanwhile, you can extend Transformer
, override its transform
method and then pattern match against the concrete form of trees you're interested in. Call super.transform
to recursively replace in subtrees.