[cocci] Evolution for data reuse with generic SmPL metavariable types?

Markus Elfring <[email protected]> Sat, 28 Mar 2026 13:56:19 +0100
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
Hello!

Metavariables are supported to some degree.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/03a1af0a3316ddfc2b54d827b8b9627a841c85c9/docs/manual/cocci_syntax.tex#L209-288

I find that their types can be distinguished by corresponding properties.

1. generic

2. number of items (which can be matched)


Examples:
* statement
* declaration


A declaration can contain the following elements.

+ variable type
+ identifier
+ attributes
+ comments


Thus it would occasionally be helpful if such contents can be reused directly.
But there are corresponding data processing constraints involved.
These data would only become usable after detection according to a (compound)
metavariable type.

How will development interests evolve to improve programming interfaces accordingly?

Regards,
Markus