On Mon, 4 Apr 2011, Michael Stefaniuc wrote:
> Hello,
>
> is there a trick to use the field list? The matching rule is easy (although it
> is awkward that F isn't followed by a ";")
> @ object @
> typedef IFace;
> typedef IFaceVtbl;
> type Tobj;
> field list[n] F;
> @@
> typedef struct tag_obj {
> F
> - const IFaceVtbl *lpVtbl;
> + IFace IFace_iface;
> ...
> } Tobj;
>
> But I cannot make the replacement rule work
> @@
> identifier obj;
> identifier vtbl;
> expression list[object.n] E;
> @@
> static struct IFaceImpl obj = {
> E,
> - &vtbl,
> + { &vtbl },
> ...,
> };
>
> I keep getting
> Fatal error: exception Failure("minus: parse error:
> = File "field_list.cocci", line 20, column 6, charpos = 296
> around = 'E', whole content = E
> ")
The metavariable for arbitrary initializers has type initialiser (or
initializer). But there is no initialiser list or initializer list. I
will add them.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)