comp.lang.ada
 help / color / mirror / Atom feed
* Can I get access to an AST of parsed ADA code?
@ 2006-05-23 19:19 ssaammee
  2006-05-23 20:40 ` Marc A. Criley
  0 siblings, 1 reply; 4+ messages in thread
From: ssaammee @ 2006-05-23 19:19 UTC (permalink / raw)


I have legacy ADA and C++ code, and I need to export this code into an
XML format so I can create a tool to analyze and work with it. I tried
various tree-dump-* commands with g++ and didn't find anything that
looked to be read-able or anything that was at a high level like my
code (GIMPLE was much to low level for me because I want to maintain
variable names and such).

Is there a way I can access the parser for either C++ or ADA so that I
can access a high level parsed version of my code? If not, can a parser
dump command be recommended?

Any help would be appreciated!
 
Thank you, 
-Sam Edwards 
Sedwards At Harmonia Dot Com




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can I get access to an AST of parsed ADA code?
  2006-05-23 19:19 Can I get access to an AST of parsed ADA code? ssaammee
@ 2006-05-23 20:40 ` Marc A. Criley
  2006-05-24 13:56   ` idbaxter
  0 siblings, 1 reply; 4+ messages in thread
From: Marc A. Criley @ 2006-05-23 20:40 UTC (permalink / raw)


ssaammee@gmail.com wrote:
> I have legacy ADA and C++ code, and I need to export this code into an
> XML format so I can create a tool to analyze and work with it. I tried
> various tree-dump-* commands with g++ and didn't find anything that
> looked to be read-able or anything that was at a high level like my
> code (GIMPLE was much to low level for me because I want to maintain
> variable names and such).
> 
> Is there a way I can access the parser for either C++ or ADA so that I
> can access a high level parsed version of my code? If not, can a parser
> dump command be recommended?

For C++ you can use GCC_XML from http://www.gccxml.org/HTML/Index.html, 
and for Ada you have ASIS2XML, http://www.pushface.org/asis2xml.

For Ada the code will have to be compilable by a version of GNAT with 
its corresponding ASIS implementation.

-- Marc A. Criley
-- McKae Technologies
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can I get access to an AST of parsed ADA code?
  2006-05-23 20:40 ` Marc A. Criley
@ 2006-05-24 13:56   ` idbaxter
  2006-05-24 17:16     ` Marc A. Criley
  0 siblings, 1 reply; 4+ messages in thread
From: idbaxter @ 2006-05-24 13:56 UTC (permalink / raw)



Marc A. Criley wrote:
> ssaammee@gmail.com wrote:
> > I have legacy ADA and C++ code, and I need to export this code into an
> > XML format so I can create a tool to analyze and work with it. I tried
> > various tree-dump-* commands with g++ and didn't find anything that
> > looked to be read-able or anything that was at a high level like my
> > code (GIMPLE was much to low level for me because I want to maintain
> > variable names and such).
> >
> > Is there a way I can access the parser for either C++ or ADA so that I
> > can access a high level parsed version of my code? If not, can a parser
> > dump command be recommended?
>
> For C++ you can use GCC_XML from http://www.gccxml.org/HTML/Index.html,
> and for Ada you have ASIS2XML, http://www.pushface.org/asis2xml.
>
> For Ada the code will have to be compilable by a version of GNAT with
> its corresponding ASIS implementation.

My understanding is that GCC_XML does not output function bodies
(see thier web page).

The DMS Software Reengineering Toolkit has robust parsers for
many dialects of C++, including ANSI, GNU, and MS Visual Studio 2005,
and parsers for Ada 83 and 95.   DMS has an option to dump
the XML produced by the parsers, and so would satisfy the OP's
request.
See http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html

Ira D. Baxter, CTO




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can I get access to an AST of parsed ADA code?
  2006-05-24 13:56   ` idbaxter
@ 2006-05-24 17:16     ` Marc A. Criley
  0 siblings, 0 replies; 4+ messages in thread
From: Marc A. Criley @ 2006-05-24 17:16 UTC (permalink / raw)


idbaxter@semdesigns.com wrote:
> Marc A. Criley wrote:
>> For C++ you can use GCC_XML from http://www.gccxml.org/HTML/Index.html,
> 
> My understanding is that GCC_XML does not output function bodies
> (see thier web page).

Yep, that's correct.  So it depends on what one needs to do with the 
C++.  If the need is to work mostly with declarations (which is all I 
care about), then GCC_XML should suffice.  If the analysis needs to be 
more comprehensive, processing the executable content as well, then one 
has to look elsewhere.

-- Marc A. Criley
-- McKae Technologies
-- www.mckae.com
-- DTraq - XPath In Ada - XML EZ Out



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-05-24 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-23 19:19 Can I get access to an AST of parsed ADA code? ssaammee
2006-05-23 20:40 ` Marc A. Criley
2006-05-24 13:56   ` idbaxter
2006-05-24 17:16     ` Marc A. Criley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox