Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* [Cocci] Using a metavariable type for function calls?
@ 2019-11-14 14:42 Markus Elfring
  2019-11-14 15:33 ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2019-11-14 14:42 UTC (permalink / raw)
  To: Coccinelle

Hello,

Some metavariable types are supported by the semantic patch language so far.
Can it become helpful to let a customised function determine the concrete
value which should be used for a source code transformation specification?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] Using a metavariable type for function calls?
  2019-11-14 14:42 [Cocci] Using a metavariable type for function calls? Markus Elfring
@ 2019-11-14 15:33 ` Julia Lawall
  2019-11-14 16:00   ` Markus Elfring
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2019-11-14 15:33 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle



On Thu, 14 Nov 2019, Markus Elfring wrote:

> Hello,
>
> Some metavariable types are supported by the semantic patch language so far.
> Can it become helpful to let a customised function determine the concrete
> value which should be used for a source code transformation specification?

I have no idea what you are asking for.  You can already write code in
python or ocaml scripts that binds metavariables that you can use in later
rules.

julia

>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] Using a metavariable type for function calls?
  2019-11-14 15:33 ` Julia Lawall
@ 2019-11-14 16:00   ` Markus Elfring
  2019-11-14 16:02     ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2019-11-14 16:00 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Coccinelle

>> Some metavariable types are supported by the semantic patch language so far.
>> Can it become helpful to let a customised function determine the concrete
>> value which should be used for a source code transformation specification?
>
> I have no idea what you are asking for.

@@
my_function get_content;
@@
-old_stuff
+get_content


> You can already write code in python or ocaml scripts that binds metavariables
> that you can use in later rules.

Do you refer to scripted constraints here?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] Using a metavariable type for function calls?
  2019-11-14 16:00   ` Markus Elfring
@ 2019-11-14 16:02     ` Julia Lawall
  2019-11-14 16:23       ` Markus Elfring
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2019-11-14 16:02 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle



On Thu, 14 Nov 2019, Markus Elfring wrote:

> >> Some metavariable types are supported by the semantic patch language so far.
> >> Can it become helpful to let a customised function determine the concrete
> >> value which should be used for a source code transformation specification?
> >
> > I have no idea what you are asking for.
>
> @@
> my_function get_content;
> @@
> -old_stuff
> +get_content
>
>
> > You can already write code in python or ocaml scripts that binds metavariables
> > that you can use in later rules.
>
> Do you refer to scripted constraints here?

No.  Like in demos/pythontococci.cocci
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Cocci] Using a metavariable type for function calls?
  2019-11-14 16:02     ` Julia Lawall
@ 2019-11-14 16:23       ` Markus Elfring
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2019-11-14 16:23 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Coccinelle

>> @@
>> my_function get_content;
>> @@
>> -old_stuff
>> +get_content

This can be another questionable idea around software extensions for
the functions “make_…” by the module “Coccilib”.

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 14:42 [Cocci] Using a metavariable type for function calls? Markus Elfring
2019-11-14 15:33 ` Julia Lawall
2019-11-14 16:00   ` Markus Elfring
2019-11-14 16:02     ` Julia Lawall
2019-11-14 16:23       ` Markus Elfring

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr
	public-inbox-index cocci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git