groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Hermans <>
Subject Looking for more Groovy 2.5 examples and detailed documentation
Date Wed, 13 Mar 2019 17:28:17 GMT

I have some AST transformations I use to generate a (builder) class and 
would like to (try to) move away from using the AST API and strings to 
build code towards using the new macro.

I can find some simple examples but can't seem to find more thorough 
documentation and examples.

I've managed to figure out a few things like if statements and 
constructors but am struggling with e.g. declarations and assignments, 
like the following :

body.addStatement(declS(varX('binding'), ctorX(ClassHelper.make(Binding))))
body.addStatement(assignS(propX(varX('binding'), 'caller'), varX('this')))

Another thing is when to use and not use $v.

If somebody could point me towards some interesting web pages (or 
transform the above code to using a macro) I would be very thankful !

Luc Hermans

Deze e-mail is gecontroleerd op virussen door AVG.

View raw message