Writing AST Transformations - Get Practical in 90 minutes
summary
Covers concrete recipes: shows a Java global AST transformation that adds a public static final author String field to every class (registered via META-INF/services), a local messenger annotation that generates a message(String) method with a boolean shout → toUpperCase behavior, and a local @Main annotation that generates public static void main (with constructor and duplicate-main checks). Demos Groovy Console AST browser, GeneralUtils/ASTBuilder helpers, Igorov’s macro/mixin extensions and a static-ST generator web tool, plus testing and phase/registration pitfalls.
AI-written summary · about
chapters (15)
- 0:00Introduction and context
- 1:56Reducing boilerplate
- 7:22Understanding AST concepts
- 9:25Using the AST browser
- 13:36Local vs global transformations
- 15:40Testing transformations
- 19:06Building a global transformation
- 29:22Creating a local transformation
- 34:50Advanced local transformation
- 49:05Handling existing methods
- 56:22Compiler error handling
- 58:21Defensive programming in AST
- 1:09:38AST for humans and utils
- 1:12:42Groovy AST builder
- 1:16:50Macro methods and conclusion








