Skip to contentSkip to conversation

Wider applications of SmPL conjunctions?

cocci Markus Elfring 1 participant 1 message Feb 15, 2024

lore
Share & tools
lore
#0 lore raw

Hello,

Special “conjunctions” are supported also by the semantic patch language.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/cc7ff34b307724845875be57d5fe9a5fadb36844/docs/manual/cocci_syntax.tex#L1041

I accordingly got some impressions from applications of this software functionality.

Some source code search patterns can be combined then by the SmPL operator “&”. It seems that an ordering of involved items would be more reasonable for such a combination than others.

* An identifier can be searched.
It can be determined then also to which expression it would belong.

* A specific compound statement can be searched
(together with included metavariables as needed).
If you would like to avoid the repetition of the same specification for a subsequent search, it can be a corresponding metavariable defined based on the type “statement”.

* Would statement lists match the next bigger item in the abstraction hierarchy?

* Will development interests grow for further topics?

Example:
Add a metavariable for the handling of source code 2018-05-23
https://github.com/coccinelle/coccinelle/issues/140

Regards,
Markus