On Sun, 6 Feb 2011, Jani Monoses wrote: > On 02/06/2011 11:54 AM, Julia Lawall wrote: > > The problem is in parsing the containing function. The current attempt to > > parse C++ is not very affective on your code... > > > > In the first case, the problem is the line: > > > > NS_IMETHODIMP nsWindow::SetTitle(const nsString& aTitle) > > > > specifically the& after nsString. What are the constraints on this&? > > Does it have to appear at the end of an identifier? Can it only appear on > > a type name? > > > > In the second case, the problem is a new: > > > > input = new char[strlen(acceptLanguage)+1]; > > > > It might be possible to recognize new and then treat it as a function > > call. > > I think a lot of such C++ snippets would be parsed by Coccinelle if > '&' and 'new' would be treated as having similar constraints as '*' and an > unary operator respectively.
Thanks. For new, it looks like it will be a little bit subtle, because I don't think char[strlen(acceptLanguage)+1] is parsable at the moment. In a variable declaration one would have an identifier name between the char and the array size. julia _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
