From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mo DeJong To: sourcenav@sourceware.cygnus.com Subject: Re: replace Date: Tue, 03 Jul 2001 14:45:00 -0000 Message-id: References: <0107032252030B.01898@localhost.localdomain> X-SW-Source: 2001-q3/msg00008.html On Tue, 3 Jul 2001, Gacquer William wrote: > I once wrote this but do not have the code anymore since I have left my last > society. That was a bit tricky cos I had to play with flex. That was a > command line tool. > > As soon as I find some time to rewrite it, I'll contribute it to SN. > > Just a question : was using flex a good idea? ( in fact, I was using it as if > it was bison! ) > > William Gacquer > EKKLA Research Well, that is actually a bit different. I was talking about a global text based find/replace. What you are talking about is a global symbol aware find/replace. Both are important, but they are two different solutions. The symbol aware search and replace should be possible using the existing symbol database. Running a search replace would consist of: 1. Find the symbols in question. 2. Edit the file in question based on the info in the DB. (file name, line number, column start and column end) 3. Save the modified file. 4. Rinse, lather, repeat. The good thing about this approach is that it makes use of the existing parsers. The downside is that some nasty grubbing around in the DB layer will be needed. Some hacking would be required, but it would be a really cool feature. Mo DeJong Red Hat Inc