concept visitor in category groovy

This is an excerpt from Manning's book Groovy in Action, Second Edition.
Global transformations are similar to local transformations except that no annotation is required to wire-in a visitor. Instead of having the end user specify when your transformation is applied, global transformations are simply applied to every single source unit in the compilation. Global transformations can also be applied to any phase in the compilation, even those before semantic analysis. With this flexibility comes a performance penalty. All compilations will take longer, even if your transformation isn’t used. For this reason you should use global transformations with reticence and consider implementing global transformations in Java or using @CompileStatic for the performance benefits.
The classes shown in figure G.2 are the general interfaces for the visitors. In practice, you will use the abstract classes defined to help you implement this pattern. That way you won’t have to worry about any method dispatch or implementing a whole bunch of uninteresting methods. Normally you want to subclass CodeVisitorSupport or ClassCodeVisitorSupport, shown in figure G.3.