On Wed, 12 Oct 2011 16:50:19 +0200, Julia Lawall <[email protected]> wrote:
Thank you for this explanations. I try to comprehend what you are
saying, I
try to read every documentation I can find (wiki still down though).
But I
don't get it:
- generated code:
"Coccinelle tries to parse both the source code and the generated code"
What is the generated code? The diff file?
Sorry, that was not super clear. It tries to parse the description of
code
that will be matched (context code and - code in the semantic patch) and
the description of code that will be generated (context code and + code
in
the semantic patch).
- identifiers:
" by exploiting the fact that you can use python or ocaml to create
identifiers"
I dont get this, identifiers are a core concept of spml - no? Do you
mean
identifier metavariables?
No, create an identifier. Concretely, create the identifier that an
identifier metavariable is bound to.
- spml identifier vs. source identifier:
"Then you can make an identifier that has an extremely strange name, eg
a name
that looks just like a function header or that looks like a close brace.
[...]"
As far as I understand identifiers in spml are abstract from names. Are
you
talking about setting a somekind of signal word into the c source code?
No. The example pythontococci.cocci, for example, says
coccinelle.z = "something"
But if you say
coccinelle.z = "int foo (int x) {"
then that can be used as an identifier (ie the value of an identifier
metavariable) as well.
Sorry to bother again ...
coccinelle.z = "something"
But if you say
coccinelle.z = "int foo (int x) {"
But this is about computation and not matching - no?
I think the first step is to match something like a nested function. And
the matching has to be done with SmPL. Will I be able to match a
semantically impossible construct with SmPL?
Because if I understand correctly script parts can not match code.
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)