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.

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)

Reply via email to