On Tue, 12 Jun 2012, SF Markus Elfring wrote:

Now I write 3 rules to remove the "MODULE" relative macros.
[...]
Is there any possobility that I can combile these rules  into a single one?

Would you like to delete all macro calls that have got a common prefix in their names? Do you need eventually a more detailed filter pattern?

How do you think about the application of a regular expression for your use case?

Would an approach like the following work with the semantic patch language?

@@
identifier xyz ~= MODULE_\w+;
expression param;
@@
-xyz(param);

Identifier doesn't work, because it has to be a declarer name. In principle declarer names could be specified as regular expressions. I'm not sure it would be a good idea in this case. The user should know what he is doing. But then I don't think regular expressions are a good idea in general (for the same reason).

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to