From: Andre B. <and...@gm...> - 2003-12-20 23:43:45
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> I'm fine with these ideas - this tracker concept will be the thing that can be taken from<br> the codemodel. The "micro ast transformation" is something to have in background when<br> starting with the real big refactoring operations, i agree.<br> <br> About that macro / preprocessing stuff.<br> <pre wrap="">> An issue that is not solved by the above idea is macro handling. It's clear > that macro should be expanded for correct parsing, but we also need to be > able to track the parameters passed to macro. For example, if a type is > passed to a macro as a parameter, we need to be able to rename the parameter > passed to the macro instead of its expanded instance. Also, some refactoring > may operate on macro (rename macro...), though in this case, it might be > easier to make a specific parser... Well, I think there's no real chance to get arround to do this preprocessing before parsing. However, a possible solution could be - and is implemented by the current preprocessor class - to save all changes done during preprocessing and use this information for later textual transformation of the refactoring. So that the needed transformations recognized in the preprocessed code can be mapped to the locations in the original code. e.g. A macro replacement changes the offset of all characters coming after the macro replacement area. At the moment only simple replacements can be handled. However, I see the chance to get this working even with the '#include' directive and parameterized macros - so that the preprocessor really includes the given header file (transformations are than mapped to the different files by using preprocess information). One hard point would be 'conflicts' where a transformation hits a macro area - here a some clever checking of preprocess information is needed. I have a good feeling that this can work even to track the parameters passed to macro. I'm currently working on this "include" thing. And of course refactoring of the current preprocess code ... and after this parameterized macros. I have added open points in the sourceforge RFE list just for your information. -- have a nice day André </pre> <blockquote type="cite" cite="mid02d001c3c6f9$00230fc0$67c2c3d4@gaia"> <pre wrap=""><!----></pre> </blockquote> <br> </body> </html> |