All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Combining isomorphisms with source code adjustments?
@ 2020-04-22  7:40 Markus Elfring
  2020-04-22 10:38 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2020-04-22  7:40 UTC (permalink / raw)
  To: Coccinelle

Hello,

I have taken another look at the following information.
https://github.com/coccinelle/coccinelle/blob/6b4bb692f208bfe86e62a616724570d9310c7150/standard.iso#L544

…
// Affectation/initialisation isomorphism
…
// They are handled in engine.
// 'X = Y'  should also match  'type X = Y';
…


I have tried another script out for the semantic patch language.

@deletion@
expression input, storage, target;
@@
 storage
-        = input
 ... when != storage
 target = ...


elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci delete_unused_value4.cocci
…
the simple assignment expression on line 4 contains transformations
that prevent it from matching a declaration (not pure)
…


How do you think about the software situation?

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

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

* Re: [Cocci] Combining isomorphisms with source code adjustments?
  2020-04-22  7:40 [Cocci] Combining isomorphisms with source code adjustments? Markus Elfring
@ 2020-04-22 10:38 ` Julia Lawall
  2020-04-22 10:52   ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2020-04-22 10:38 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]



On Wed, 22 Apr 2020, Markus Elfring wrote:

> Hello,
>
> I have taken another look at the following information.
> https://github.com/coccinelle/coccinelle/blob/6b4bb692f208bfe86e62a616724570d9310c7150/standard.iso#L544
>
> …
> // Affectation/initialisation isomorphism
> …
> // They are handled in engine.
> // 'X = Y'  should also match  'type X = Y';
> …
>
>
> I have tried another script out for the semantic patch language.
>
> @deletion@
> expression input, storage, target;
> @@
>  storage
> -        = input
>  ... when != storage
>  target = ...
>
>
> elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci delete_unused_value4.cocci
> …
> the simple assignment expression on line 4 contains transformations
> that prevent it from matching a declaration (not pure)
> …
>
>
> How do you think about the software situation?

I think what the message says.  You have put a - in an awkward place so it
may not be able to apply some isomorphisms.

julia

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

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

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

* Re: [Cocci] Combining isomorphisms with source code adjustments?
  2020-04-22 10:38 ` Julia Lawall
@ 2020-04-22 10:52   ` Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2020-04-22 10:52 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Coccinelle

>> @deletion@
>> expression input, storage, target;
>> @@
>>  storage
>> -        = input
>>  ... when != storage
>>  target = ...
>>
>>
>> elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci delete_unused_value4.cocci
>> …
>> the simple assignment expression on line 4 contains transformations
>> that prevent it from matching a declaration (not pure)
>> …
>>
>>
>> How do you think about the software situation?
>
> I think what the message says.  You have put a - in an awkward place so it
> may not be able to apply some isomorphisms.

I got the impression that the Coccinelle software can handle changes
together with isomorphisms at other source code places already.

* Why is this functionality restricted here?

* The reported software limitation can trigger undesirable code duplication
  if a corresponding transformation approach would be required so far
  to express extra case distinctions by the means of SmPL disjunctions.

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

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

end of thread, other threads:[~2020-04-22 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-22  7:40 [Cocci] Combining isomorphisms with source code adjustments? Markus Elfring
2020-04-22 10:38 ` Julia Lawall
2020-04-22 10:52   ` Markus Elfring

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.