Coccinelle archive on lore.kernel.org
 help / color / 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)
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 index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 15:00 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

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr
	public-inbox-index cocci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git