All of lore.kernel.org
 help / color / mirror / Atom feed
From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Clarification for scripted SmPL constraints
Date: Sat, 17 Feb 2018 15:34:43 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1802171531330.2205@hadrien> (raw)
In-Reply-To: <9d550db4-cad4-f625-32da-173078fdde54@users.sourceforge.net>



On Sat, 17 Feb 2018, SF Markus Elfring wrote:

> >> I would appreciate if the place for the desired predicate will be better explained.
> >>
> >> May they refer to a predefined function?
> >
> > When you write eg
> >
> > identifier x : script:python(...) { ... };
> >
> > or
> >
> > identifier x : script:ocaml(...) { ... };
> >
> > Between the { ... } you can put any code that you could put in a python or
> > ocaml script, respectively.
>
> Which parameters should be passed to the selected function?

You can always pass the declared metavariable.  You can put a
comma-separated list of inherited metavariables (r.a, r.b, ...) between
the parentheses, and then use a, b, etc in the script code.  If there are
no disjunctions in the rule and if the declared metavariable is no
seprated by ... from a metavariable previously declared in the same rule,
then the latter variable can be included in the () as well, with no rule
name, and then used in the script code.

julia

  parent reply	other threads:[~2018-02-17 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 13:34 [Cocci] Avoiding code duplication for SmPL constraints SF Markus Elfring
2018-02-17 13:39 ` Julia Lawall
     [not found]   ` <388d5af8-d3e4-ee18-7481-3675e2b52024@users.sourceforge.net>
2018-02-17 14:11     ` Julia Lawall
     [not found]       ` <9d550db4-cad4-f625-32da-173078fdde54@users.sourceforge.net>
2018-02-17 14:34         ` Julia Lawall [this message]
2018-02-17 14:54           ` [Cocci] Clarification for scripted " 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.20.1802171531330.2205@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.