On Fri, 27 May 2011, Francis Galiegue wrote:

> On Fri, May 27, 2011 at 09:26, Julia Lawall <[email protected]> wrote:
> > On Fri, 27 May 2011, Francis Galiegue wrote:
> >
> >> Hello,
> >>
> >> Normally, to (un)match identifiers/expressions against values, you
> >> have to use regular expressions and the ~= or ~! operators.
> >>
> >> However, you can also write:
> >>
> >> expression E != NULL;
> >>
> >> Whereas the = and != operators are normally meant to (un)match against
> >> other tokens.
> >>
> >> Are there other reserved keywords like this one?
> >
> > You can use any identifier (an explicit one, not a metavariable) or a
> > constant after the !=.  NULL is not a reserved keyword for Coccinelle.
> >
> 
> Hmm, and it is only valid with !=, not with =?
> 
> For instance, I have tried:
> 
> ----
> @@
> identifier f = execl;
> expression E != NULL;
> @@
> 
>   f(..., E
> + , NULL
>   )
> ----
> 
> That doesn't work. But "f != execl" does. Which means Coccinelle will
> always try to find a previous reference for the '=' operator but not
> for '!='?

I don't see the point of allowing =.  If you want f only to be execl, then 
use execl.

Unfortunately, for this sort of question, you might really want to consult 
the BNF :)

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

Reply via email to