Rexexps suffer from high false positive rate; by definition, a "regular expression" cannot parse a context-free langauge such as C ++. Moreover, regular expressions cannot account type information;
fooT i=0;
ok, for some typedef'd fooT? Finally, a regex cannot change code; you may consider Perl or SED (using regular expressions to modify changes), but you will get erroneous changes due to false positives for regular expressions. On a 10M SLOC, this can't be fun; A 5% error means that 50,000 lines of code are possible for manual correction.
You can consider the program conversion tool . Such engines work on language structures, and not in the text, and more complex versions know the areas, types and meaning of the symbol (for example, what is fooT, exactly?). They offer you the ability to write langauge- and context-sensitive templates and offer constructively correct code changes using the surface syntax of the target language. This allows you to reliably apply code changes to scale.
Our DMS Software Reengineering Toolkit with its C ++ Front End has been used to bulk modify large C ++ systems using syntax and type. (See Akers, R., Baxter, I., Mehlich, M., Ellis, B., Luecke, K., Case Study: Reconstructing C ++ Component Models Using Automatic Transformation of Programs, Information, and Software Technologies 49 (3 ): 275-291 2007.)
source share