code review about IASTPreprocessorStatement [message #753615] |
Fri, 28 October 2011 05:02 |
anson 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);
}
}
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03099 seconds