Does anyone out there know about examples and the theory behind parsers that will take (maybe) an abstract syntax tree and produce code, instead of vice-versa. Mathematicall
Such thing is called a Visitor. Is traverses the tree and does whatever has to be done, for example optimize or generate code.