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.

Jani

_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to