cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Continuation for a code search after a common SmPL rule?
Date: Tue, 21 May 2019 07:57:39 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1905210756490.2773@hadrien> (raw)
In-Reply-To: <78de5a84-1651-c5eb-4fbd-35362c93abef@web.de>



On Tue, 21 May 2019, Markus Elfring wrote:

> Message repetition from 2019-05-16 because of a temporary technical difficulty
> with the mailing list services:
>
> =====
>
> Hello,
>
> The semantic patch language can handle several rules which can contain
> remarkable amounts of source code search specifications.
> It can happen then that a few of these SmPL rules contain a bit of
> common specifications.
>
> Example:
> @one@
> @@
> code_area_1
> code_area_2
>
> @two@
> @@
> code_area_1
> code_area_3
>
>
> Now I would like to clarify possibilities again to reduce unwanted
> code duplication at such places.
> The common code part can be moved to another SmPL rule.
>
> @start@
> @@
> code_area_1
>
>
> Subsequent SmPL rules can refer to metavariables from previous rules.
> But how can be achieved that the code search will be continued at a place
> after the position where a previous rule ended its search
> (without extra code repetition)?
>
> Can the splitting and recombination of such rules become more convenient
> with extensions for the Coccinelle software?

In general it can't.  Coccinelle doesn't have the goal of minimizing the
number of characters in te semantic patch.  It has the goal of making
readable specifications that follow the structure of the matched code.

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

  reply	other threads:[~2019-05-21  5:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a639ce38-81a1-8825-73b0-2b7ba53e6588@web.de>
2019-05-21  5:54 ` [Cocci] Continuation for a code search after a common SmPL rule? Markus Elfring
2019-05-21  5:57   ` Julia Lawall [this message]
2019-05-21  6:15     ` Markus Elfring

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.1905210756490.2773@hadrien \
    --to=julia.lawall@lip6.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).