On Wed, 2 Feb 2011, SF Markus Elfring wrote:
> > I think that all you want is the ability to specify a function like;
> > \(foo\|xxx\|yyy\)(...) {
>
> Do you suggest an extension for the semantic patch language syntax here?
More of a completion. Disjunctions are allowed in a lot of other places,
but not in a function name at the moment.
> Is the selection for a couple of function names (with the help of regular
> expressions) not directly supported by SmPL at this place?
Regular expressions are fine too, but they help less with efficiency. If
a regular expression is the only thing you can do, eg because you want all
functions with the name get_*, then you can just do that. But if you only
want foo, xxx, and yyy, then it is better to specify that in the semantic
patch, because then it will only pick files that contain the names foo,
xxx, and yyy.
>
> > <...
> > - alpha()
> > + beta()
> > ...>
> > }
>
> This shows just the simple use case for renaming or replacing of function
> calls.
> http://coccinelle.lip6.fr/docs/main_grammar011.html#toc1
Sure, but you can put whatever you want in between <... ...>. This was
just a random example.
> This is not enough for a "convenient" and elegant solution I am looking for
> the
> completion of error detection.
> Would you like to express any scope limitations like "function
> implementation/body" in the SmPL meta-variable declaration area (the "@@
> block")?
No, I don't see any need to do that. The pattern that I wrote before does
exactly the same thing.
I realize that you don't see the point of this, but it would really help a
lot if you would actually try ot write the semantic patch that you want,
test it on some files, and then come back with the concrete problems that
you find. A priori, I don't see anything especially difficult about what
you would like to do, although some difficulties may arise in
practice.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)