|
From: Andre B. <and...@gm...> - 2003-12-16 13:57:58
|
a small description how preprocessing has been integrated into the refactoring tool. The preprocessor has replaced the former 'NoneSemanticBlanker' which was some special kind of preprocessing handling comments and strings. The preprocessor class still uses this blanker class to do the required processing after doing the usual preprocessing. The current implementation of preprocessing does currently support only simple macro replacements. This shows that the idea works. A next goal should be the handling of #include directives. I will check this in the next weeks. However, all preprocessing operations do change the text - how can we trace back these modifications when doing our refactorings ? Well, I have implemented this tracking very simple by using the TransformationList which was originally designed to store all code modifications of a refactoring operation - well, now it also stores entries of preprocessing operations. These can be used to calculate the source positions in original code and that's it !! Well I have also implemented a detection of conflics of doing refactorings to positions where macro replacement has been executed. Currently the refactoring engine simply stops the refactoring -> later we can think about strategies, like removing the macro and use the replacement text in this case. Or even we can try to modify the macro definition, but that are some gimmicks I believe. This preprocessing integration was not integrated into the part where the new CodeWriter has been used - I want to check this next. Until later, André |