mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 13:25:45 +02:00
Minor fix to ASTView.
This commit is contained in:
parent
bcedb9a5c1
commit
7f65d614a3
1 changed files with 5 additions and 6 deletions
|
@ -32,7 +32,6 @@ import org.eclipse.cdt.core.dom.ast.c.ICASTDesignatedInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignator;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction;
|
import org.eclipse.cdt.internal.core.dom.parser.c.CVisitor.CBaseVisitorAction;
|
||||||
import org.eclipse.cdt.internal.core.parser.scanner2.LocationMap.ASTObjectMacro;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author dsteffle
|
* @author dsteffle
|
||||||
|
@ -170,28 +169,28 @@ public class CPopulateASTViewAction extends CBaseVisitorAction implements IPopul
|
||||||
private void mergeNode(ASTNode node) {
|
private void mergeNode(ASTNode node) {
|
||||||
addRoot(node);
|
addRoot(node);
|
||||||
|
|
||||||
if (node instanceof ASTObjectMacro)
|
if (node instanceof IASTPreprocessorMacroDefinition )
|
||||||
addRoot(((ASTObjectMacro)node).getName());
|
addRoot(((IASTPreprocessorMacroDefinition)node).getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mergeMacros(IASTPreprocessorMacroDefinition[] macros) {
|
private void mergeMacros(IASTPreprocessorMacroDefinition[] macros) {
|
||||||
for(int i=0; i<macros.length; i++) {
|
for(int i=0; i<macros.length; i++) {
|
||||||
if (macros[i] instanceof ASTNode)
|
if (macros[i] instanceof ASTNode)
|
||||||
mergeNode((ASTNode)macros[i]);
|
mergeNode((ASTNode)macros[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mergePreprocessorProblems(IASTProblem[] problems) {
|
private void mergePreprocessorProblems(IASTProblem[] problems) {
|
||||||
for(int i=0; i<problems.length; i++) {
|
for(int i=0; i<problems.length; i++) {
|
||||||
if (problems[i] instanceof ASTNode)
|
if (problems[i] instanceof ASTNode)
|
||||||
mergeNode((ASTNode)problems[i]);
|
mergeNode((ASTNode)problems[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mergeIncludeDirectives(IASTPreprocessorIncludeStatement[] includes) {
|
private void mergeIncludeDirectives(IASTPreprocessorIncludeStatement[] includes) {
|
||||||
for(int i=0; i<includes.length; i++) {
|
for(int i=0; i<includes.length; i++) {
|
||||||
if (includes[i] instanceof ASTNode)
|
if (includes[i] instanceof ASTNode)
|
||||||
mergeNode((ASTNode)includes[i]);
|
mergeNode((ASTNode)includes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue