Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Denis Efremov <efremov@ispras.ru>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] How to match a part of a rule expression (documentation)
Date: Thu, 4 Jun 2020 09:31:46 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.2006040930360.2577@hadrien> (raw)
In-Reply-To: <8e45d3b0-61d5-3e3a-b93e-8ffc67462476@ispras.ru>

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]



On Thu, 4 Jun 2020, Denis Efremov wrote:

> On 6/3/20 10:45 PM, Julia Lawall wrote:
> > subE is a expressionof whatever expression was previously matched to E in
> > the rule ifm.  <= can only be used when the metavariable on the right side
> > is inherited from another rule.  Ths is probably what you want for your
> > problem.
>
> In this case I don't understand the difference between:
>
> "expression ifm.E" and "expression subE <= ifm.E"

subE should match any subexpression of ifm.E.  If you have a concrete
example (code and semantic patch) where it is not doing that, I can look
at it.  I haven't used this feature very much.

julia

>
> For example, in kfree.cocci:
>
> @r exists@
> expression free.E, subE<=free.E, E2;
> expression E1;
> ...
> @@
>
> (
> * kfree@p1(E,...)
> |
> * kzfree@p1(E,...)
> )
> ...
> (
>  iter(...,subE,...) S // no use
> |
>  list_remove_head(E1,subE,...)
> |
>  subE = E2
>
>
> Regards,
>
> Denis
>
>

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

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

      reply	other threads:[~2020-06-04  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 17:33 [Cocci] How to match a part of a rule expression (documentation) Denis Efremov
2020-06-03 19:45 ` Julia Lawall
2020-06-03 22:09   ` Denis Efremov
2020-06-04  7:31     ` Julia Lawall [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=alpine.DEB.2.21.2006040930360.2577@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=efremov@ispras.ru \
    /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