cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] More precise distinction of types for source code searches?
Date: Wed, 26 Jun 2019 10:36:38 +0200	[thread overview]
Message-ID: <07d5b071-f236-a933-2519-580e29e13774@web.de> (raw)
In-Reply-To: <alpine.DEB.2.21.1906251636360.2556@hadrien>

> @@
> expression x;
> constant c1,c2;
> @@
>
> x = c1;

The SmPL manual contains the promising wording “As metavariables are bound
and inherited across rules, …”.
https://github.com/coccinelle/coccinelle/blob/c6d7554edf7c4654aeae4d33c3f040e300682f23/docs/manual/cocci_syntax.tex#L179

The mentioned binding and inheritance can still become clearer.
I guess that the Coccinelle software constructs corresponding internal
data structures. The application experience shows that specific matched values
can be directly reused in subsequent SmPL rules already.


> (
> x = c1;

Can it make sense then to support the direct access to a matched item also
as a constraint within the same SmPL rule?
How do you think about to work with backreferences to known data for further
checking (or exclusion) of such source code?


> |
> *x = c2;
> )

Will any SmPL constraint extensions result in the consequence to construct
a special metavariable type?

Will the software situation evolve further around the usage of such SmPL disjunctions?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

      parent reply	other threads:[~2019-06-26  8:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 12:51 [Cocci] More precise distinction of types for source code searches? Markus Elfring
2019-06-25 12:40 ` Markus Elfring
2019-06-25 14:38   ` Julia Lawall
2019-06-25 17:09     ` Markus Elfring
2019-06-26  8:36     ` Markus Elfring [this message]

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=07d5b071-f236-a933-2519-580e29e13774@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@lip6.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 NNTP newsgroup(s).