Program to rename C/C++ symbols (variables/functions)

O

OvErboRed

Is there a program that can help me safely rename a variable, function,
constant, macro, etc. in either C or C++? Simple search-and-replace doesn't
work, because you need something that understands the semantics, scoping
rules, and so forth. I guess I'm looking for something like cscope, but
with replacement functionality. (Even better: is there such a tool that is
vim-friendly?) Thanks in advance for any pointers.
 
R

Rob Williscroft

OvErboRed wrote in in
comp.lang.c++:
Is there a program that can help me safely rename a variable,
function, constant, macro, etc. in either C or C++? Simple
search-and-replace doesn't work, because you need something that
understands the semantics, scoping rules, and so forth. I guess I'm
looking for something like cscope, but with replacement functionality.
(Even better: is there such a tool that is vim-friendly?) Thanks in
advance for any pointers.

google for: refactoring browser C++

Rob.
 
O

OvErboRed

I was able to find Xrefactory for Emacs and CDT for Eclipse (neither of
which I use), and nothing that was stand-alone.
 
I

Ira Baxter

OvErboRed said:
Is there a program that can help me safely rename a variable, function,
constant, macro, etc. in either C or C++? Simple search-and-replace doesn't
work, because you need something that understands the semantics, scoping
rules, and so forth. I guess I'm looking for something like cscope, but
with replacement functionality. (Even better: is there such a tool that is
vim-friendly?) Thanks in advance for any pointers.

Our DMS Software Reengineering Toolkit has a full C front
end with name and type resolution, which means it understands
all the scoping rules, etc, and can identify for each symbol,
its point of declaration and all uses. DMS can also carry
out program transformations. So this would be relatively
straightforward to implement.

It isn't an "editor" in the interactive text-string sense.
Rather, it executes predefined transforms.
Somebody has to predefine them, and we call
this customization. It'd take about a day to set
up a renaming transform.

(Our corresponding Java front end for DMS has
"rename identifier" built-in, so it is 30 seconds
to customize it for this task.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top