[prev in list] [next in list] [prev in thread] [next in thread]
List: kdevelop-devel
Subject: Re: probably the best C++ parser...
From: Alexander Neundorf <neundorf () kde ! org>
Date: 2005-07-01 15:17:23
Message-ID: 200507011717.23858.neundorf () kde ! org
[Download RAW message or body]
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
--
Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de
Home: neundorf@kde.org - http://www.kde.org
alex@neundorf.net - http://www.neundorf.net
_______________________________________________
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