We implemented an algorithm for layout preservation in refactorings.
The algorithm reconstructs the source code after a transformation on the abstract syntax tree, preserving the layout of the original source code.
The library will be integrated in the Spoofax language workbench in the near future.
Until then you can use the library in your Spoofax project by copying the code from subversion:
https://svn.strategoxt.org/repos/StrategoXT/refactoring/lib-reconstruction/
Revision: r1.3 - 19 Nov 2010 - 21:45 - EelcoVisser