I posted a question on the DOxygen forums and also am posting it here for a better response.
I have a moderately sized C project of about 2,900 functions. I am using DOxygen 1.5.9 and it is successfully generating a call graph for the functions. Is there a way to extract this out for further analysis? A simple paired list would be sufficient, e.g.
Caller,Callee
FunctionX, FunctionY
...
I am comfortable with XSLT but I must say that the 开发者_StackOverflowDOxygen XML output is complex. Has anyone done this before and can provide some guidance on how to parse the XML files?
Thanks in advance!
Based on what I see in the contrived example that I created,
- Parse files with a name similar to
^_(.+)\d+(c|cpp|h|hpp)\.xml$, if my regex-foo is right. - Find all
<memberdef kind="function">. It has a uniqueidattribute. I believe the XPath for this is//memberdef[@kind='function']. - Within that element, find all
<references>. - For each of those tags, the
refidattribute uniquely refers to theidattribute of the corresponding<memberdef>that is being called. - The text node within each
<references>corresponds to the<name>of the corresponding<memberdef>that is being called.
This seems like a nice, straightforward way to express call graphs. You should have no trouble using XSLT or any other sane XML-parsing suite to get the desired results.
加载中,请稍侯......
精彩评论