From: rob@hoelz.ro (Rob Hoelz)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Patching string literal juxtaposition
Date: Mon, 15 Jan 2018 10:59:35 -0600 [thread overview]
Message-ID: <20180115105935.430cae15@eridanus> (raw)
In-Reply-To: <58ff3bae-29c1-19cf-99f1-5b96e7855101@users.sourceforge.net>
On Thu, 11 Jan 2018 14:30:16 +0100
SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> > @@
> > constant char *stock_constant =~ "^GTK_STOCK";
> > @@
> >
> > -"+" stock_constant
> > +stock_constant
> >
> > For starters, Coccinelle doesn't seem to recognize string
> > juxtaposition (spatch gives me an error when I try this);
>
> It would be nice if this small source code adjustment could be
> specified also for the semantic patch language in such a convenient
> and succinct way. But the Coccinelle software provides a specific
> behaviour for string literals so far. I imagine then that you could
> achieve the desired transformation with an other approach.
>
> * How do you think about to choose any of the supported programming
> languages for the construction of corresponding SmPL script rules?
> http://coccinelle.lip6.fr/docs/main_grammar003.html
>
> * A ?constant? could be stored in a script variable by this
> metavariable type. http://coccinelle.lip6.fr/docs/main_grammar002.html
>
> The received input string can be adjusted in ways you like by
> additional function calls from the available programming interfaces.
> Would you like to propagate the constructed value back to another
> script rule by calling the SmPL method ?make_expr??
>
> Regards,
> Markus
>
I'm *very* much new to Coccinelle, so I think I'll have to trying the scripting
interface as per Julia's suggestion. I think I need to experiment with Coccinelle
a bit (or a lot!) more to get the hang of it.
-Rob
prev parent reply other threads:[~2018-01-15 16:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 2:22 [Cocci] Patching const char * constants Rob Hoelz
2018-01-10 8:40 ` Julia Lawall
2018-01-10 19:34 ` Rob Hoelz
[not found] ` <5ab8be10-1f1a-707b-b629-e25e7fb731fa@users.sourceforge.net>
2018-01-15 16:57 ` [Cocci] Patching string literal juxtaposition Rob Hoelz
[not found] ` <58ff3bae-29c1-19cf-99f1-5b96e7855101@users.sourceforge.net>
2018-01-15 16:59 ` Rob Hoelz [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=20180115105935.430cae15@eridanus \
--to=rob@hoelz.ro \
--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.