I looked through the v3 examples but didn't spot what I'm looking for, which is: Pass 1: Normal grammar that writes a tree. Pass 2 thru N-1: Tree grammars that rewrite the tree. Optimizers, if you like. Pass N: Tree grammar that writes string-templates to produce final output. Can anyone point me to such a thing?