[Cocci] Wildcard matching

Nicolas Palix npalix at diku.dk
Thu Apr 30 15:44:49 CEST 2009


On Thursday 30 April 2009 15:15:58 Derek M Jones wrote:
> Julia,
> 
> > Sure.  But some don't.  In looking at Linux code, sometimes the same 
> > prefix is used for more than one thing, and sometimes a few things in a 
> > particular category do not contain the expected prefix.  For automatic 
> 
> Lots don't, but there are probably enough who do to make it worthwhile.
> Perhaps I will make this my introduction to Coccinelli internals
> project.
> 
> Oh and the specific identifier reference should be:
> www.knosof.co.uk/cbook/sent792.pdf
> 

Hi,

As a workaround, you could use Python.
Match on any identifier for a function name, and then inherit this identifier
in Python. You could analyse it at your convenience in Python.
Finally, use print or cocci.print_main to display something
or just discard the match with cocci.include_match(False)

Regards
-- 
Nicolas Palix


More information about the Cocci mailing list