shared code between MacroGroovy and AstBuilderTransformation