This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC/UML/XMI extraction (was gcc front end )



All I wanted was to get the class structure. 
I had not explored other available tools which give out class info. and hence my (premature) e-mail.
My plans were never ambitious ,  and require only header file info.
and I'll certainly Never abuse gpl.
your mails have been most helpful.
thanks,
praveen


----- Original Message ----- 
From: "Richard Stallman" <rms@gnu.org>
To: <p.sarathy@usa-tcs.com>
Cc: <mdupont777@yahoo.com>; <gcc@gcc.gnu.org>; <introspector-developers@lists.sourceforge.net>
Sent: Sunday, May 12, 2002 11:34 AM
Subject: Re: GCC/UML/XMI extraction (was gcc front end )


James wrote

    You would like to extract the class structures of a
    given program into UML, maybe into a XMI like data
    format?

Praveen, could you tell me more precisely what job you want to do?
Do you want to record just the class structure, or something more?

I see no problem of abuse in making cc1 record information on the
class structure.  The question is purely a technical one, as long
as that is as far as the feature goes.

In general, using output from GCC's parse phase to record
cross-reference information is a flawed technique because it does not
understand preprocessor conditionals.  If your code says

foo ()
{
#if defined (__gnu__) || defined (__unix__)
  foo_1 ();
#else
  foo_2 ();
#endif
}

then a cross reference meant to help a human understand the program
should say that foo calls both foo_1 and foo_2.  However, a cross
reference generated in the straightforward way from inside a compiler
would mention only one of them.

This issue arises for call graphs in C code.  C++ class structure is a
different issue.  Perhaps people rarely use preprocessor conditionals
in ways that affect the class structure.  If so, this issue would not
arise for that specific application.

However, the Emacs OOBR already has the ability to analyze the class
structure of a program and then browse it.  Does it already do what
you want?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]