What is an AST transformation in general? I came across these words when reading Groovy blog's. But what it is in general?
AST means Abstract Syntax Tree, which is basically an abstract representation of code / any syntactic structure. A transformation is an action modifying this tree (i.e. transforming the existing AST to a new AST). For more information have a look here: http://en.wikipedia.org/wiki/Abstract_syntax_tree
In addition to what have been mentioned already, you might also be interested in a broader and more fundamental concept of Term rewriting.
The simple answer is any function that converts one AST, into another AST.
A more sophisticated view can be found in my SO answer on Model-driven development: What is a transform?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With