On Sun, 8 Jul 2018, SF Markus Elfring wrote:
> 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?
F(..., 9);
(
*G(1, ...);
|
*H(2, ...);
)
should be fine.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci