> @@
> identifier i;
> expression E;
> statement S;
> @@
>
> + i = E;
>   if (
>   !
> - (i = E)
> + i
>   ) S

Try this one without the ! and with S converted to

S1 else S2

with S1 and S2 being statement metavariables.  I think that the various
isoorphisms should cause this to do everything.  But you can check it by
running spatch --parse-cocci file.cocci.  for this, it is more readable if
you give your rule a short name, like r, because it will put the name of
the rule in each metavariable that it prints, and the defaut is quite
long.

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to