refactoring using parser

Keith Ray <[email protected]>
Newsgroups gmane.comp.programming.refactoring
Message-ID <[email protected]>
replying to "Peng Yu" [email protected]

The Rename Refactoring is currently available in Eclipse CDT along with a
few other refactorings.

Some plug-in refactoring tools may be available to you if you are using
certain versions of Visual Studio.

What you can often do when refactoring C++ code [and you don't have a
refactoring tool] is to rely on the compiler to find all the code you want
to change.

To change the name of a class (or function, etc.), go ahead and change its
name and then compile and look at all the errors you get. This will find
find all places that were using the old class name, and not give false
matches like a global search-and-replace might do.  Of course, you will get
a LOT of other errors cascading from the name change, so depending on the
code size and complexity, a careful search-and-replace may be the faster
alternative.

Sometimes relying on the compiler can fail: a "change-function-signature"
refactoring could continue to compile even when you want it not to because
of implicit type conversions.

-- 
C. Keith Ray, IXP Coach, Industrial Logic, Inc.
http://industriallogic.com      866-540-8336 (toll free)
Groove with our Agile Greatest Hits:
http://www.industriallogic.com/elearning/
http://agilesolutionspace.blogspot.com/


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/refactoring/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/refactoring/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.