[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
AW: [cdt-core-dev] How to get the function calls from a c/cpp project
|
Hello,
I suspect you'll need to go this way:
- From the translation unit get the AST translation unit, i.e.
IASTTranslationUnit asttu = translationUnit.getASTTranslationUnit() ;
- Implement a visitor which will collect all function calls, derived
from org.eclipse.cdt.core.dom.ast.ASTVisitor. There is a number of
pre-implemented visitors in org.eclipse.cdt.core plug-in, just open the
type hierarchy for ASTVisitor.
- Pass your visitor to asttu.accept(myVisitor) and it should be able to
collect the information you want.
And for sure there are others out there who can give more advice ?
Good luck!
Norbert
________________________________
Von: cdt-core-dev-bounces@xxxxxxxxxxx
[mailto:cdt-core-dev-bounces@xxxxxxxxxxx] Im Auftrag von jamsheer pk
Gesendet: Mittwoch, 18. Januar 2006 12:42
An: cdt-core-dev@xxxxxxxxxxx
Betreff: [cdt-core-dev] How to get the function calls from a c/cpp
project
I am writing a code to parse the c/cpp project. I have the c projetc
name as ICProject. Now I want to parse this project to get all the
function calls. But when I am using the statement
List functions =
translationUnit.getChildrenOfType(ICElement.C_FUNCTION);
I am getting all the childrens of type function definitions. Not
function call. Can anybody tell me how to get that
--
"Our Greatest Glory is Not in Never Failing, But in Rising Every Step We
Fall "