Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an AST transformation?

What is an AST transformation in general? I came across these words when reading Groovy blog's. But what it is in general?

like image 458
Aravinth Avatar asked Jun 04 '11 06:06

Aravinth


3 Answers

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

like image 161
Markus Avatar answered Nov 08 '22 13:11

Markus


In addition to what have been mentioned already, you might also be interested in a broader and more fundamental concept of Term rewriting.

like image 21
SK-logic Avatar answered Nov 08 '22 15:11

SK-logic


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?

like image 5
Ira Baxter Avatar answered Nov 08 '22 15:11

Ira Baxter