All of lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Extract an interface with SmPL
Date: Sat, 26 Apr 2014 17:52:47 +0200	[thread overview]
Message-ID: <535BD64F.4000700@users.sourceforge.net> (raw)
In-Reply-To: <CABxcv=nOLP3mR1jWf_k=ahdQ=5Y-O=CimmKUWACVuAmzGpOsHQ@mail.gmail.com>

> Great, I didn't know that this kind of refactoring pattern was named
> ExtractInterface and yes that's exactly what I want to achieve here.

Thanks for your feedback.

It will help to discuss further approaches after the goal is clear with a name
that is well-known for some software designers and developers. I hope that
experiences from other tools can eventually be reused then.


> I'm sure other subsystems will benefit from the same semantic patch if
> is generic enough so makes sense to me to be included to a demo collection.

Coccinelle provides a "small" semantic pattern collection for demonstration
purposes already.
https://github.com/coccinelle/coccinelle/tree/master/demos

Would you like to extend it with approaches for source code refactoring?


> Probably the only change that will have to be made in the spatch is
> the regular expression to filter the function names and the name of
> the two data structures.

I imagine that there are some software development challenges for the
implementation with the semantic patch language.

1. You refer to designated initializers from the standard "ISO/IEC 9899:1999".
   http://thevirtualmachinist.blogspot.de/2012/03/c99-designated-initializers.html

   Do you need to consider the case when they are not used in a source file?

2. You mentioned a few variations already. How difficult or interesting will the
handling of optional elements become?

3. Initialisation and assignment statements can vary in their number and order
generally. How would you like to treat differences here?

4. Do you need to introduce unique names for variables and involved data structures?

Regards,
Markus

  reply	other threads:[~2014-04-26 15:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25 12:32 [Cocci] semantic patch feasibility Javier Martinez Canillas
2014-04-25 14:30 ` SF Markus Elfring
2014-04-25 16:24   ` Julia Lawall
2014-04-25 16:31     ` SF Markus Elfring
2014-04-25 18:03       ` Julia Lawall
2014-04-25 18:50         ` Javier Martinez Canillas
2014-04-25 21:28           ` Julia Lawall
2014-04-25 22:02             ` Javier Martinez Canillas
2014-04-25 18:39     ` Javier Martinez Canillas
2014-04-25 18:33   ` Javier Martinez Canillas
2014-04-25 20:52     ` SF Markus Elfring
2014-04-25 21:30       ` Julia Lawall
2014-04-25 21:31     ` Julia Lawall
2014-04-25 16:23 ` Julia Lawall
2014-04-25 18:37   ` Javier Martinez Canillas
2014-04-25 21:25     ` Julia Lawall
2014-04-25 21:58       ` Javier Martinez Canillas
2014-04-26  5:11         ` Julia Lawall
2014-04-26  8:30         ` SF Markus Elfring
2014-04-26 14:06           ` Javier Martinez Canillas
2014-04-26 15:52             ` SF Markus Elfring [this message]
2014-04-26 16:06               ` [Cocci] Extract an interface with SmPL Julia Lawall
2014-04-26 16:31                 ` Javier Martinez Canillas
2014-04-26 10:59     ` [Cocci] semantic patch feasibility Julia Lawall
2014-04-25 16:34 ` Wolfram Sang

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=535BD64F.4000700@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.