[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: probably the best C++ parser...
From:       Matt Rogers <mattr () kde ! org>
Date:       2005-07-03 17:24:10
Message-ID: 200507031224.13211.mattr () kde ! org
[Download RAW message or body]

On Friday 01 July 2005 10:17 am, Alexander Neundorf wrote:
> On Friday 01 July 2005 17:01, Alexander Neundorf wrote:
> > ...you can find is gcc, but did you know gccxml
> > (http://www.gccxml.org/HTML/Index.html) ? It's basically the real gcc,
> > but it doesn't produce machine instructions, but an xml file describing
> > the source file.
> > So you get
> > -all functions
> > -all variables
> > -all parameters for functions
> > -the locations where the functions are declared (file and line number)
> > etc. in a machine-readable format.
>
> Here's a very simple example:
>
> ----------8<-----------8<--------------8<-----------
>
> struct EmptyClass {};
>
> int a_function(float f, EmptyClass e)
> {
> }
>
> int main(void)
> {
>   return 0;
> }
>
> ----------8<-----------8<--------------8<-----------
>
> and the resulting xml:
>
> <?xml version="1.0"?>
> <GCC_XML>
>   <Namespace id="_1" name="::" members="_2 _3 _4 "/>
>   <Function id="_2" name="main" returns="_5" context="_1" location="f0:8"/>
>   <Function id="_3" name="a_function" returns="_5" context="_1"
> location="f0:4">
>     <Argument name="f" type="_6"/>
>     <Argument name="e" type="_4"/>
>   </Function>
>   <Struct id="_4" name="EmptyClass" context="_1" location="f0:1"
> members="_7 _8 " bases=""/>
>   <FundamentalType id="_5" name="int"/>
>   <FundamentalType id="_6" name="float"/>
>   <Constructor id="_7" name="EmptyClass" context="_4" location="f0:1">
>     <Argument name="_ctor_arg" type="_9"/>
>   </Constructor>
>   <Constructor id="_8" name="EmptyClass" context="_4" location="f0:1"/>
>   <ReferenceType id="_9" type="_4c"/>
>   <File id="f0" name="example1.cxx"/>
> </GCC_XML>
>
> Alex

That's all well and good, except for the fact that XML parsing (at least with 
Qt, and possibly other libraries as well) is way too slow to be useful in 
this case (especially since we're using bdb)

Now, if Ian would hurry up and replace bdb with something else then maybe 
speed wouldn't be such an issue. Also, I've seen other posts that say that 
gccxml doesn't provided everything needed for refactoring support, etc., but 
I don't know that for sure, so i'm just quoting what the other person said. 

I like this idea, but I'm wondering if there are other issues lurking here 
that we're not yet aware of

-- 
Matt

[Attachment #3 (application/pgp-signature)]
_______________________________________________
KDevelop-devel mailing list
KDevelop-devel@barney.cs.uni-potsdam.de
http://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic