O'Reilly logo

Groovy in Action, Second Edition by Dierk König and Paul King with Guillaume Laforge, Hamlet D'Arcy, Cédric Champeau, Erik Pragt, and Jon Skeet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix G. AST visitors

After reading chapter 9, you should have a general idea of what types of tasks compile-time metaprogramming can offer, how Groovy gets compiled into AST and eventually bytecode, and which tools you’ll need for further exploration. We’re all set to dig in and see some of the details of AST. This appendix focuses on walking and reading an AST. We’ll look at the options for code visitors and the implementation of a static analysis tool for Groovy.

The examples in chapter 9 are focused on writing new information into the AST of a class. Transformations give you the class and method nodes you need to work with as parameters. This is enough when you want to write AST. But things aren’t always so simple. Often, we need to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required