* [Cocci] metavariables for initialize/finalize
@ 2013-06-19 21:37 Julia Lawall
2013-06-21 7:29 ` [Cocci] Improvements for Coccinelle API SF Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2013-06-19 21:37 UTC (permalink / raw)
To: cocci
SmPL allows defining initialize and finalize script rules that are rnu
before and after the treatment of any files, repectively. They are useful
for managing counters, hash tables, etc. and for defining frequently used
script functions.
At the moment, they do not allow the declaration of any metavariables. In
particular the syntax is, eg:
@initialize:python@
python code
without the second @@ as found in all other kinds of rules.
The problem is that this makes it impossible to refer to command line
arguments (ie virtual identifiers) in the initialize and finalize rules,
which can be useful.
One possibility would be to add metavariable declarations, as found
elsewhere. This would mean adding @@ to any existing semantic patches
that contain initialize and finalize rules.
Another option would be to make the second @@ optional. This preserves
backward compatability, but it makes the language more complex, and it is
not so easy to implement, because normally I don't parse the script code.
A third option would be to make it possible to refer to eg virtual.xyz
directly in the script code, regardless of the language. These would then
get replaced by their values from the command line before passing the code
to the interpreter of the script language.
What do you think? I prefer the fist option, because the language remains
(indeed, becomes more) uniform. But the backward compatability is an
issue. On the other hand, maybe most people don't use initialize and
finalize rules?
Thanks,
julia
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cocci] Improvements for Coccinelle API
2013-06-19 21:37 [Cocci] metavariables for initialize/finalize Julia Lawall
@ 2013-06-21 7:29 ` SF Markus Elfring
2013-06-21 8:19 ` Nicolas Palix
0 siblings, 1 reply; 3+ messages in thread
From: SF Markus Elfring @ 2013-06-21 7:29 UTC (permalink / raw)
To: cocci
> A third option would be to make it possible to refer to eg virtual.xyz
> directly in the script code, regardless of the language.
I would prefer such an approach. I'd like to suggest that a specific
function will return an object which provides access to a general
application programming interface for Coccinelle.
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cocci] Improvements for Coccinelle API
2013-06-21 7:29 ` [Cocci] Improvements for Coccinelle API SF Markus Elfring
@ 2013-06-21 8:19 ` Nicolas Palix
0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Palix @ 2013-06-21 8:19 UTC (permalink / raw)
To: cocci
On Fri, Jun 21, 2013 at 9:29 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>
>> A third option would be to make it possible to refer to eg virtual.xyz
>> directly in the script code, regardless of the language.
>
>
> I would prefer such an approach.
For me, it is the worst of the three options.
Are you going to implement it
and to maintain it in the long term ?
> I'd like to suggest that a specific
> function will return an object which provides access to a general
> application programming interface for Coccinelle.
We already have that...
>
> Regards,
> Markus
> _______________________________________________
> Cocci mailing list
> Cocci at systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
--
Nicolas Palix
Tel: +33 4 76 51 46 27
http://membres-liglab.imag.fr/palix/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-21 8:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-19 21:37 [Cocci] metavariables for initialize/finalize Julia Lawall
2013-06-21 7:29 ` [Cocci] Improvements for Coccinelle API SF Markus Elfring
2013-06-21 8:19 ` Nicolas Palix
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.