cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Checking the parsing for a specific SmPL disjunction
Date: Thu, 25 Jun 2020 20:00:48 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2006251959450.6463@hadrien> (raw)
In-Reply-To: <79cbff87-a004-aa34-1b1c-6229c645389d@web.de>



On Thu, 25 Jun 2020, Markus Elfring wrote:

> >> @display@
> >> expression x, y;
> >> @@
> >> *y = ... *(x) ...
> >
> > This is probably not what you think.  It is an assignment of y to a
> > multiplication followed by some other code (the second ...).
>
> I would interpret such a source code search approach in the way
> that a varying expression which contains one known (?) operation
> is assigned to an other target.
>
> Can the ambiguity for the asterisk (before the parentheses) be avoided?
>
>
> Should the following script variant for the semantic patch language
> match only code with pointer dereferences?
>
> @display@
> expression* x;
> expression y;
> @@
> *y = ... *(x) ...

There is no ... like this at the expression level.  You can say <+...
*(x) ...+> if you want *(x) to be a subexpression of the right hand side.

julia


>
>
>
> >> @display@
> >> expression action, x, y;
> >> @@
> >> (
> >> *y = ... *(x) ...
> >> |
> >> *action(..., x, ...)
> >> )
>
> May I expect that such SmPL disjunctions should also work?
>
> Regards,
> Markus
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

      parent reply	other threads:[~2020-06-25 18:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 15:00 [Cocci] Checking the parsing for a specific SmPL disjunction Markus Elfring
2020-06-25 15:11 ` Julia Lawall
     [not found]   ` <79cbff87-a004-aa34-1b1c-6229c645389d@web.de>
2020-06-25 18:00     ` 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.22.394.2006251959450.6463@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=Markus.Elfring@web.de \
    --cc=cocci@systeme.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).