All of lore.kernel.org
 help / color / mirror / Atom feed
From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Usage of "expressions" and "identifiers" with SmPL
Date: Sat, 8 Oct 2016 08:57:34 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1610080856400.7750@hadrien> (raw)
In-Reply-To: <20a829ad-af8d-ee46-8e61-8ba06098c1f5@users.sourceforge.net>

Nicolaus, please ignore this message.

julia

On Sat, 8 Oct 2016, SF Markus Elfring wrote:

> > To me, an identifier is something that's written literally into the
> > source code and cannot be meaningfully taken apart, e.g. a function
> > name, variable name, or the member of a struct. An expression, on the
> > other hand, is something that can be meaningfully split into
> > sub-components. Is that also how you use these terms?
>
> Yes, in principle.
>
> The Coccinelle software was designed for the generation of semantic patches.
>
> 1. Its tool "spatch" expects some input and will usually produce
>    corresponding output.
>
> 2. One kind of such input are source files for which data processing
>    is also directly supported if they were mostly written in a programming
>    language like "C".
>
> 3. Another kind of required input is the specification of source code search
>    or transformation patterns in the semantic patch language.
>
> 4. Special data processing is also possible just because the programming
>    languages "OCaml" and "Python" can be used in SmPL script rules already.
>
> 5. There are several languages involved. SmPL script developers need to be
>    careful about the relevant syntax context.
>
>    * So while you are looking from a view of "C source", you might tend
>      to think about "C identifiers". The semantic patch language provides
>      metavariables which can get the data type "identifier".
>
>    * But what was an "item" in the source language can become an other
>      in the Coccinelle technology.
>      One example is the use of a metavariable with the type "idexpression"
>      in your case. At which places would you start to think about a code
>      situation by the means of "expressions"?
>
>    * Syntax constructs from the supported source languages are matched with
>      "key words" that are often similar (or even identical) to the host language
>      (within SmPL scripts).
>
>
> >> @ connects patterns that match the same term.  So match a term against the
> >> explicit name ptr and also match it against an identifier expression that
> >> has a particular type.  This is not exactly a beginner example.
> >
> > Okay, I'll just ignore that for now.
> >
> >>> I'd hate to waste your time asking tons of such trivial questions on the
> >>> mailing list, but I just can't find any helpful documentation at all...
> >>
> >> If you look on the web page in the papers and slides section, at the top
> >> there are several tutorials and overview talks, some with video.
> >
> > I think I looked at everything that is not a video.
>
> Thanks for your feedback.
>
>
> > But none of it mentioned that you can put an arbitrary name between the @@
>
> I got an other impression from the available documentation.
>
>
> > or explained what the different metavariable types (idexpression,
> > expression, etc) are.
>
> I see some improvement possibilities there, too.
>
>
> > Anyway, enough whining. Coccinelle seems like a really useful tool,
>
> Yes, of course.
>
>
> > even if I'm having an impedance mismatch with its documentation.
>
> Do you see further chances to reduce this mismatch for following
> software developers?
>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

  reply	other threads:[~2016-10-08  6:57 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05  3:27 [Cocci] Replacing one (specific!) type with another Nikolaus Rath
2016-10-05  5:45 ` Julia Lawall
2016-10-05 16:09   ` Nikolaus Rath
2016-10-05 16:39     ` Michael Stefaniuc
2016-10-05 17:21     ` [Cocci] Replacing one variable name " SF Markus Elfring
2016-10-05 22:34       ` Nikolaus Rath
2016-10-06  5:42         ` SF Markus Elfring
2016-10-06  5:56         ` Julia Lawall
2016-10-05 20:02     ` [Cocci] Replacing one (specific!) type " Julia Lawall
2016-10-05 22:38       ` Nikolaus Rath
2016-10-06  5:55         ` Julia Lawall
2016-10-08  3:16           ` Nikolaus Rath
2016-10-08  5:50             ` Julia Lawall
2016-10-08 20:45               ` Nikolaus Rath
2016-10-08 21:23                 ` Julia Lawall
2016-10-09  6:32                 ` SF Markus Elfring
2016-10-08  6:48             ` [Cocci] Usage of "expressions" and "identifiers" with SmPL SF Markus Elfring
2016-10-08  6:57               ` Julia Lawall [this message]
     [not found]               ` <alpine.DEB.2.10.1610080850470.7750@hadrien>
2016-10-08  7:49                 ` SF Markus Elfring
2016-10-08  7:56                   ` Julia Lawall
2016-10-08  8:26                     ` SF Markus Elfring
2016-10-08  8:38                       ` Julia Lawall
2016-10-08  9:25                         ` SF Markus Elfring
2016-10-08 20:28                           ` Nikolaus Rath
2016-10-09  7:49                             ` SF Markus Elfring
2016-10-09 20:38                               ` Nikolaus Rath
2016-10-10  6:48                                 ` SF Markus Elfring
2016-10-10  6:50                                   ` Julia Lawall
2016-10-06  6:30         ` [Cocci] Replacing one (specific!) type with another SF Markus Elfring
2016-10-08  4:22       ` Nikolaus Rath
2016-10-08  5:31         ` Julia Lawall
2016-10-08 20:52           ` Nikolaus Rath
2016-10-08 21:21             ` Julia Lawall
2016-10-09 20:45               ` Nikolaus Rath
2016-10-10  4:49                 ` Julia Lawall
2016-10-10  4:54                 ` Julia Lawall
2016-10-10 15:56                   ` Nikolaus Rath
2016-10-10 18:45                     ` Nikolaus Rath
2016-10-10 19:45                       ` Julia Lawall
2016-10-10 21:27                         ` Nikolaus Rath
2016-10-10 21:33                           ` Julia Lawall
2016-10-10 23:00                             ` Nikolaus Rath
2016-10-11  6:51                               ` Julia Lawall
2016-10-12 15:08                                 ` Nikolaus Rath
2016-10-12 20:37                                   ` Julia Lawall
2016-10-05  5:51 ` SF 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.10.1610080856400.7750@hadrien \
    --to=julia.lawall@lip6.fr \
    --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.