From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Applicability of SmPL inheritance?
Date: Sun, 8 Jul 2018 09:42:09 +0200 [thread overview]
Message-ID: <1ed9edbe-e2aa-dfec-a2c3-fb43274f2c2e@users.sourceforge.net> (raw)
Hello,
I would like to clarify another combination of functionality from the semantic
patch language.
The following small SmPL script can be constructed to find some function calls.
@rtg@
identifier F, G;
@@
F(..., 9);
*G(1, ...);
@rth@
identifier F, H;
@@
F(..., 9);
*H(2, ...);
The important detail is here that both SmPL rules specify to search for
the same function calls before other source code should be found.
This common SmPL code could be moved into another SmPL rule.
@rpx@
identifier F;
position P;
@@
F(..., 9);@P
@rpg@
identifier rpx.F, G;
position rpx.P;
@@
F(..., 9);@P
*G(1, ...);
@rph@
identifier rpx.F, H;
position rpx.P;
@@
F(..., 9);@P
*H(2, ...);
I became curious to know if the shown inherited information could be used also
without repeating SmPL code for a precondition.
Can the search be continued directly behind the determined source code position?
Regards,
Markus
next reply other threads:[~2018-07-08 7:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-08 7:42 SF Markus Elfring [this message]
2018-07-08 7:46 ` [Cocci] Applicability of SmPL inheritance? Julia Lawall
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=1ed9edbe-e2aa-dfec-a2c3-fb43274f2c2e@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 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).