On Mon, 14 May 2018, SF Markus Elfring wrote:
> Hello,
>
> I am curious on how good the Coccinelle software can support a specific
> source code transformation:
> It would be occasionally nice if an implementation of a function could be
> completely stored into a metavariable.
> Is a statement list variable appropriate for this use case?
Yes.
@@
identifier f;
statement list SS;
@@
f() {
SS
}
A statement list metavariable should only be used as the body of a block
{}. If it is not working at the top of a function, it should be possible
to fix that.
> Can these data be moved to an other function (or macro definition)?
Yes. A statement list variable can be added anywhere a list of statements
is allowed, ie not necessarily as the complete body of a block.
julia
>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> [email protected]
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci