Coccinelle archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr
Subject: [cocci] Wider applications of SmPL conjunctions?
Date: Thu, 15 Feb 2024 11:15:51 +0100	[thread overview]
Message-ID: <01fe8b37-9fff-4137-818c-8a851ce588a3@web.de> (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

                 reply	other threads:[~2024-02-15 10:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01fe8b37-9fff-4137-818c-8a851ce588a3@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).