On Fri, 24 Aug 2012, Nicolas Palix wrote:

> On Fri, Aug 24, 2012 at 2:36 PM, Arie Middelkoop <[email protected]> wrote:
> > On 24/08/12 14:10, Nicolas Palix wrote:
> >>
> >> Julia/Arie, maybe providing Ast_c manipulation functions and access
> >> to the Pretty_print_c would help a lot in such cases.
> >
> >
> > Ocaml scripts should have access to Ast_c and Pretty_print_c. There is at
> > least one test in the tests directory that does so.
>
> My script uses Ast_c but I have to embed few functions to manipulate it
> in the script. As far as I know, there is no API to easily manipulate
> Ast_c objects as Coccinelle does internally.
>
> Concerning the pretty_print_c module, could you point me
> to the test file, please ?
>
> Ast_c provides unwrap, str_of_info and str_of_name which will
> help in that case but I was looking for the more general pretty printer
> which serializes any ast node. I think it is the Pretty_print_c module
> which is not mentioned in ocaml/yes_prepare_ocamlcocci.ml.

I don't think that there exists a pretty printer that can serialize any
ast node.  Some pretty printers are indeed provided in pretty_print_c.ml.
I think Arie has changed the way that Coccinelle libraries are made
available to ocaml, so it would probably be easier if he could add it.  It
does seem reasonable to have it available, although if the user tries to
do anything complicated, he will likely be disappointed...

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to