On Sat, 27 Nov 2010, Jani Monoses wrote: > Hello, > > I heard that writing a complete C++ parser is very hard, but I was wondering > if Coccinelle could be made to work on C++ codebases > only handling the C subset of the language and ignoring what it does not > treat. > > If the whole AST is needed than this is probably unfeasable, but if smaller > units can be handled independently then maybe very simple transformations like > renaming functions or dropping arguments could be still done, ignoring whether > the code is within a function or a method call. > > The only open source C++ code transformation tool I have heard of is Pork but > it is much more difficult to set up and use than Coccinelle at the moment so > it would be nice to be able to do relatively easy things > in C++ or mixed C/C++ codebases.
I think it is possible, and indeed a C++ parser has been written that is compatible with Coccinelle. Doing the simple case as you suggest is even probably not too hard. But at the moment we do not have the resources to look into it. julia _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
