Transform a source into a targ\et using grammar templates