Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » code review about IASTPreprocessorStatement
code review about IASTPreprocessorStatement [message #753615] Fri, 28 October 2011 05:02
anson  is currently offline anson Friend
Messages: 1
Registered: October 2011
Junior Member
Dear All:

I have a question about IASTPreprocessorStatement.
Because i get the IASTPreprocessorStatement from IASTTranslationUnit.
but the generated IASTPreprocessorStatement has it own Node and not in the same file.
How do I know the analyzed file for IASTPreprocessorStatement node line number ?


source code here:

public void analyze(AnalysisHistory history) {



CodeReviewResource resource = (CodeReviewResource) getProvider()
.getProperty(history.getHistoryId(),
CodeReviewProvider.RESOURCE_PROPERTY);
IASTTranslationUnit unit = resource.getResourceCompUnit();



IASTPreprocessorStatement statements[] = unit
.getAllPreprocessorStatements();


for (int i = 0; i < statements.length; i++) {

System.out.println("Node Name:" + statements[i].getRawSignature());

if (statements[i] instanceof IASTPreprocessorIfndefStatement) {

System.out.println("Got Node ,IASTPreprocessorIfndefStatement");
System.out.println("Node File:"+statements[i].getFileLocation());


if (statements[1 + i] instanceof IASTPreprocessorIncludeStatement) {
IASTPreprocessorIncludeStatement it104 = (IASTPreprocessorIncludeStatement) statements[1 + i];
resource.generateResultsForASTNode(this, history
.getHistoryId(), it104);

}
}

}

}
Previous Topic:Problem with project's includes
Next Topic:Colors of highlight
Goto Forum:
  


Current Time: Fri Apr 26 21:05:35 GMT 2024

Powered by FUDForum. Page generated in 0.03099 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top