mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Cosmetics.
Change-Id: If6660920227beedfa8d2c39c3e24cf1bd6454d5e
This commit is contained in:
parent
4a9287acb5
commit
9240257992
3 changed files with 7 additions and 11 deletions
|
@ -308,7 +308,7 @@ public abstract class ASTVisitor {
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int visit( IASTProblem problem ){
|
public int visit(IASTProblem problem) {
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public interface IBinding extends IAdaptable {
|
||||||
public ILinkage getLinkage();
|
public ILinkage getLinkage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the binding that owns this binding, or <code>null</code> if there is no owner.
|
* Returns the binding that owns this binding, or {@code null} if there is no owner.
|
||||||
* <p>
|
* <p>
|
||||||
* The owner is determined as follows:
|
* The owner is determined as follows:
|
||||||
* <br> {@link ICPPUsingDeclaration}: The owner depends on where the declaration is found,
|
* <br> {@link ICPPUsingDeclaration}: The owner depends on where the declaration is found,
|
||||||
|
|
|
@ -40,14 +40,14 @@ public class ASTHelper {
|
||||||
private ASTHelper() {
|
private ASTHelper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static public IASTNode getDeclarationForNode(IASTNode node) {
|
public static IASTNode getDeclarationForNode(IASTNode node) {
|
||||||
while (node != null && !(node instanceof IASTSimpleDeclaration) && !(node instanceof IASTParameterDeclaration)) {
|
while (node != null && !(node instanceof IASTSimpleDeclaration) && !(node instanceof IASTParameterDeclaration)) {
|
||||||
node = node.getParent();
|
node = node.getParent();
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public IASTDeclarator getDeclaratorForNode(IASTNode node) {
|
public static IASTDeclarator getDeclaratorForNode(IASTNode node) {
|
||||||
IASTNode tmpNode = getDeclarationForNode(node);
|
IASTNode tmpNode = getDeclarationForNode(node);
|
||||||
|
|
||||||
IASTDeclarator declarator = null;
|
IASTDeclarator declarator = null;
|
||||||
|
@ -63,7 +63,7 @@ public class ASTHelper {
|
||||||
return declarator;
|
return declarator;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public IASTDeclSpecifier getDeclarationSpecifier(IASTNode declaration) {
|
public static IASTDeclSpecifier getDeclarationSpecifier(IASTNode declaration) {
|
||||||
if (declaration != null) {
|
if (declaration != null) {
|
||||||
if (declaration instanceof IASTSimpleDeclaration) {
|
if (declaration instanceof IASTSimpleDeclaration) {
|
||||||
IASTSimpleDeclaration simpleDecl = (IASTSimpleDeclaration) declaration;
|
IASTSimpleDeclaration simpleDecl = (IASTSimpleDeclaration) declaration;
|
||||||
|
@ -122,9 +122,7 @@ public class ASTHelper {
|
||||||
IASTTranslationUnit unit, String aktFileName) {
|
IASTTranslationUnit unit, String aktFileName) {
|
||||||
Collection<IASTPreprocessorStatement> statements = new ArrayList<IASTPreprocessorStatement>();
|
Collection<IASTPreprocessorStatement> statements = new ArrayList<IASTPreprocessorStatement>();
|
||||||
for (IASTPreprocessorStatement aktStatement : unit.getAllPreprocessorStatements()) {
|
for (IASTPreprocessorStatement aktStatement : unit.getAllPreprocessorStatements()) {
|
||||||
if (aktStatement.getFileLocation() == null) {
|
if (aktStatement.getFileLocation() != null && aktStatement.getFileLocation().getFileName().equals(aktFileName)) {
|
||||||
continue;
|
|
||||||
} else if (aktStatement.getFileLocation().getFileName().equals(aktFileName)) {
|
|
||||||
statements.add(aktStatement);
|
statements.add(aktStatement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,9 +132,7 @@ public class ASTHelper {
|
||||||
public static Collection<IASTDeclaration> getAllInFileDeclarations(IASTTranslationUnit unit, String aktFileName) {
|
public static Collection<IASTDeclaration> getAllInFileDeclarations(IASTTranslationUnit unit, String aktFileName) {
|
||||||
Collection<IASTDeclaration> decls = new ArrayList<IASTDeclaration>();
|
Collection<IASTDeclaration> decls = new ArrayList<IASTDeclaration>();
|
||||||
for (IASTDeclaration aktDecl: unit.getDeclarations()) {
|
for (IASTDeclaration aktDecl: unit.getDeclarations()) {
|
||||||
if (aktDecl.getFileLocation() == null) {
|
if (aktDecl.getFileLocation() != null && aktDecl.getFileLocation().getFileName().equals(aktFileName)) {
|
||||||
continue;
|
|
||||||
} else if (aktDecl.getFileLocation().getFileName().equals(aktFileName)) {
|
|
||||||
decls.add(aktDecl);
|
decls.add(aktDecl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue