Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OT: Accessing the results of gcc's parse

1 view
Skip to first unread message

Helmut Giese

unread,
Nov 20, 2009, 5:27:05 PM11/20/09
to
Hello out there,
I once read about a tool (maybe even OS?) which somehow extracted or
otherwise obtained the result of gcc parsing a C file. This tool then
used the information to - whatever.
Getting hold of this parse information would interest me, too - might
be easier than perfecting my own parser to handle the darker corners
of C.

If this rings a bell with someone please reflect the sounds over here.
Thanks and a nice weekend to all readers of clt.
Helmut Giese

Chris McDonald

unread,
Nov 20, 2009, 5:48:43 PM11/20/09
to
Helmut Giese <hgi...@ratiosoft.com> writes:


Have a look in the standard man gcc
and search for all the options of the form -fdump

There's a score of them, each able to produce a file of output at a
specific (requested) stage in the parsing, compilation, optimization,
and code generation phases.

There's undoubtably documentation on gcc's website explaining the format
of each of these files.

--
Chris.

Thomas Schnurrenberger

unread,
Nov 21, 2009, 5:23:01 AM11/21/09
to
Helmut Giese wrote:
> Hello out there,
> I once read about a tool (maybe even OS?) which somehow extracted or
> otherwise obtained the result of gcc parsing a C file. This tool then
> used the information to - whatever.

There is a tool named gcc_xml. More information here:

http://www.gccxml.org

HTH

--
Thomas

Helmut Giese

unread,
Nov 21, 2009, 5:44:46 AM11/21/09
to
Hi Thomas,

>> Hello out there,
>> I once read about a tool (maybe even OS?) which somehow extracted or
>> otherwise obtained the result of gcc parsing a C file. This tool then
>> used the information to - whatever.
>
>There is a tool named gcc_xml. More information here:
>
>http://www.gccxml.org
that's the one.
Thanks for backing up my memory and best regards
Helmut Giese

Helmut Giese

unread,
Nov 21, 2009, 5:47:25 AM11/21/09
to
Hi Chris,

>Have a look in the standard man gcc
>and search for all the options of the form -fdump
>
>There's a score of them, each able to produce a file of output at a
>specific (requested) stage in the parsing, compilation, optimization,
>and code generation phases.
>
>There's undoubtably documentation on gcc's website explaining the format
>of each of these files.
many thanks for this info. While Thomas pointed me to the tool I had
in mind it could well be worthwhile to explore the different options
gcc itself offers.
Best regards
Helmut Giese

Ira Baxter

unread,
Nov 21, 2009, 6:10:51 PM11/21/09
to
"Helmut Giese" <hgi...@ratiosoft.com> wrote in message
news:o85eg5t70r31vf68h...@4ax.com...

> Hello out there,
> I once read about a tool (maybe even OS?) which somehow extracted or
> otherwise obtained the result of gcc parsing a C file. This tool then
> used the information to - whatever.
> Getting hold of this parse information would interest me, too - might
> be easier than perfecting my own parser to handle the darker corners
> of C.

For C, see http://www.semanticdesigns.com/Products/FrontEnds/CFrontEnd.html.
For C++, see
http://www.semanticdesigns.com/Products/FrontEnds/CppFrontEnd.html

These front ends are built on top of DMS, customizable program analysis
and transformation infrastructure, see
http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html
DMS can be configured to dump as much or as little of the compiler-like data
structures that result from a full parse of the source code: ASTs, symbol
tables, flow anlayses,
...


--
Ira Baxter, CTO
www.semanticdesigns.com


Ira Baxter

unread,
Nov 21, 2009, 6:12:30 PM11/21/09
to
"Helmut Giese" <hgi...@ratiosoft.com> wrote in message
news:53hfg5dkvai7ke6ed...@4ax.com...

> Hi Thomas,
>>> Hello out there,
>>> I once read about a tool (maybe even OS?) which somehow extracted or
>>> otherwise obtained the result of gcc parsing a C file. This tool then
>>> used the information to - whatever.
>>
>>There is a tool named gcc_xml. More information here:
>>
>>http://www.gccxml.org
> that's the one.

GCCXML will dump type and declaration information.

It won't give you information about the content of C functions.
DMS does.

-- IDB


Helmut Giese

unread,
Nov 22, 2009, 4:18:26 PM11/22/09
to
Hi Ira

>For C, see http://www.semanticdesigns.com/Products/FrontEnds/CFrontEnd.html.
>For C++, see
>http://www.semanticdesigns.com/Products/FrontEnds/CppFrontEnd.html
>
>These front ends are built on top of DMS, customizable program analysis
>and transformation infrastructure, see
>http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html
>DMS can be configured to dump as much or as little of the compiler-like data
>structures that result from a full parse of the source code: ASTs, symbol
>tables, flow anlayses,
>...
thanks for those links, looks interesting.
BTW, how come the CTO of Semantic Designs reads clt? :)
Best regards
Helmut Giese
0 new messages