Have you done the source env.sh that set PFFF_HOME so that pfff knows where to find its configuration files?
On Mon, Aug 22, 2011 at 3:26 PM, Simon <[email protected]> wrote: > Thanks, I following the install instructions. Everything went well. > How can invoke pfff without it complaining (see below)? > $ cat example.c > int > myfunc(int arg1, int arg2) > { > return arg1 + arg2; > } > $ pfff -dump_cpp example.c > Using /home/pad/pfff//data/cpp_stdlib/macros.h macro file > exn Unix_error: No such file or directory stat > /home/pad/pfff//data/cpp_stdlib/macros.h > Fatal error: exception Unix.Unix_error(20, "stat", > "/home/pad/pfff//data/cpp_stdlib/macros.h") > Thanks, > Simon > On Mon, Aug 22, 2011 at 2:52 PM, yoann padioleau <[email protected]> > wrote: >> >> You need ocaml 3.12. The pattern at this line use a feature introduced in >> 3.12. >> >> On Mon, Aug 22, 2011 at 2:39 PM, Simon <[email protected]> wrote: >> > On Mon, Aug 22, 2011 at 1:58 PM, yoann padioleau >> > <[email protected]> >> > wrote: >> >> >> >> it's in the repository of pfff, in the lang_cpp/parsing subdirectory. >> >> https://github.com/facebook/pfff >> >> (it can also parse lots of C++ code). >> >> There is a -dump_cpp option to pfff that may do what you want. >> > >> > Thanks. I tried to compile pfff so that I can try out the -dump_cpp >> > option >> > but I get an error at the 'make depend' stage: >> > $ /usr/bin/ocaml -version >> > The Objective Caml toplevel, version 3.11.2 >> > $ make depend >> > ... >> > make[1]: Entering directory `/tmp/facebook-pfff-446e09a/h_visualization' >> > ocamldep -I ../commons -I ../commons/lib-json *.mli *.ml > .depend >> > File "treemap.ml", line 133, characters 23-24: >> > Error: Syntax error >> > make[1]: *** [depend] Error 2 >> > make[1]: Leaving directory `/tmp/facebook-pfff-446e09a/h_visualization' >> > make: *** [depend] Error 2 >> > Any ideas? >> > Thanks, >> > Simon >> > >> >> >> >> On Mon, Aug 22, 2011 at 1:49 PM, Julia Lawall <[email protected]> wrote: >> >> > On Mon, 22 Aug 2011, Simon wrote: >> >> > >> >> >> On Mon, Aug 22, 2011 at 12:43 PM, Julia Lawall <[email protected]> >> >> >> wrote: >> >> >> >> >> >> > On Mon, 22 Aug 2011, Simon wrote: >> >> >> > >> >> >> > > On Mon, Aug 22, 2011 at 11:11 AM, SF Markus Elfring < >> >> >> > > [email protected]> wrote: >> >> >> > > >> >> >> > > > > Ideally I'd like at least enough info to be able to >> >> >> > > > > reconstruct >> >> >> > > > > the >> >> >> > > > source >> >> >> > > > > file exactly from the pretty-printed C tree. And have yet >> >> >> > > > > more >> >> >> > > > > info >> >> >> > > > > which identifies individual C statements and their parts. >> >> >> > > > >> >> >> > > > Would you like to perform any data processing on abstraction >> >> >> > > > levels >> >> >> > like >> >> >> > > > the >> >> >> > > > following? >> >> >> > > > - control flow graph (CFG) >> >> >> > > > - abstract sematic graph (ASG) >> >> >> > > > - abstract syntax tree (AST) >> >> >> > > > >> >> >> > > >> >> >> > > If there was a way to pretty print Coccinelle's abstract syntax >> >> >> > > tree, and >> >> >> > it >> >> >> > > also contained file, line, and position info, then this would >> >> >> > > probably >> >> >> > allow >> >> >> > > me to do the type of data processing that I'm interested in. Is >> >> >> > > there a >> >> >> > way >> >> >> > > to pretty print Coccinelle's abstract syntax tree? Thanks, Simon >> >> >> > >> >> >> > Not really. But it would seem ike you would rather not use >> >> >> > Coccinelle, ie >> >> >> > the SmPL language, and instead just use its parser. You could >> >> >> > then >> >> >> > modify >> >> >> > its pretty printer to generate the information you want. >> >> >> > >> >> >> >> >> >> Thanks. Can you please point me towards the parser and its code and >> >> >> if >> >> >> it >> >> >> has a limited pretty printer already, how can I invoke it? >> >> > >> >> > All of the C-related code is in the parsing_c subdirectory. You >> >> > would >> >> > want to use the code for implementing the -type_c option as a model, >> >> > I >> >> > think. The entry point for the -type_c option would be found in that >> >> > directory as well. >> >> > >> >> > It may be easier to just get the yacfe parser from Yoann Padioleau. >> >> > Then >> >> > you wouldn't have to extract the parser from the Coccinelle source >> >> > code. >> >> > Unfortunately, I'm not really finding the most recent version, so >> >> > perhaps >> >> > Yoann will see this and let you know where it is. >> >> > >> >> > julia >> >> > _______________________________________________ >> >> > Cocci mailing list >> >> > [email protected] >> >> > http://lists.diku.dk/mailman/listinfo/cocci >> >> > (Web access from inside DIKUs LAN only) >> >> > >> > >> > > > _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
