RE: Batch code editing (was: [GD-General] C++ analyzers?)
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2002-07-18 21:48:41
|
> Forgot to mention another handy technique: search & replace > with an intermediate name, like > "m_foobar_TEMPORARY_CRAZY_UNIQUE_IDENTIFIER", > fix the errors, then do a global perl script on the unique > identifier. It'll be hard to turn foobar into blahbar that way. Yeah, that's what I do. It just really, really bites. > already. The fundamental problem is that C++ is incredibly > hard to parse; in fact it's still an unsolved problem :) Someone told me that the C++ spec still doesn't have a full BNF grammar. Is that true? > But, I believe this new generation of compilers (GCC 3, and VC.net or > whatever) is much better about exporting program metadata, so > maybe it will be possible to build tools off that. I think one of the fundamental problems is that we're still stuck in an "editing text" mentality, and until we let go of that, it's tough to really improve things. Emacs manages to work around this a lot, and there are some aspects of Emacs I wish MSVC had, like the ability to collapse functions, comments, etc. Little things like this can make a big difference when trying to manage code. Sadly enough, I was impressed when I noticed that MSVC would put whatever comment you placed next to a variable in the little "Variable info" bubble. I mean, it's just pathetic when something that trivial is capable of impressing someone in this day and age. I would LOVE to be able to run this mythical (apparently) tool that would generate output like: *** WARNING: foo.cpp, line 3, "#include <stdio.h>", nothing reference from header file *** WARNING: bar.hpp, line 16, "class Foozle", class declared but never used *** WARNING: bar.hpp, line 199, "Bar::m_iUnused", declared but never referenced The few times that a compiler has tried to warn me about dumb stuff, it's usually bogus. The most recent one was when GCC warned that I had a class that could not be instantiated nor could it be derived from (it was a pure static class, which it should have figured out). Oh well, I can dream. And yes, I do appreciate that C++ is so amazingly complex that determining anything about anything is a bitch. I'm still amazed that I get the occasional run-time error with "pure virtual function called" =) Brian |