On 26/06/12 11:32, SF Markus Elfring wrote:
Can I seperate them to 2 cocci files?
Is there any mechanism like "#inclue" in C?
Yes, I believe you can do just like in C.
When will such a feature "SmPL include" be mentioned in the grammar
documentation for the semantic patch language?
You can specify top-level includes which is defined as nonterminal
include_cocci in the manual. It lists the following productions:
\RULE{\rt{include\_cocci}}
\CASE{include \NT{string}}
\CASE{using \NT{string}}
\CASE{using \NT{pathToIsoFile}}
So, to include something, you probably want to do something like:
include "file.cocci"
using "file.cocci"
(without a preceeding hash)
The #include also occurs in the grammar, but that's (I expect) intended
for use in patterns that match against #include-constructions in C
source files.
Disclaimer: this i show I interpret the manual. I did not try whether
the actual implementation is doing it like this.
Arie
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)