1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-09-20 11:09:40 -07:00
parent 59efb5abcf
commit d7d38fd21f
4 changed files with 29 additions and 46 deletions

View file

@ -50,7 +50,7 @@ public class CASTProblemDeclaration extends CASTProblemOwner implements IASTProb
} }
} }
super.accept(action); // visits the problem super.accept(action); // Visit the problem.
if (action.shouldVisitDeclarations) { if (action.shouldVisitDeclarations) {
switch (action.leave(this)) { switch (action.leave(this)) {

View file

@ -109,8 +109,8 @@ public class CScope implements ICScope, IASTInternalScope {
IndexFilter.C_DECLARED_OR_IMPLICIT IndexFilter.C_DECLARED_OR_IMPLICIT
}; };
private IASTNode physicalNode = null; private IASTNode physicalNode;
private boolean isCached = false; private boolean isCached;
private final CharArrayObjectMap<?> mapsToNameOrBinding[] = { CharArrayObjectMap.EMPTY_MAP, CharArrayObjectMap.EMPTY_MAP }; private final CharArrayObjectMap<?> mapsToNameOrBinding[] = { CharArrayObjectMap.EMPTY_MAP, CharArrayObjectMap.EMPTY_MAP };
private final EScopeKind kind; private final EScopeKind kind;
@ -125,9 +125,6 @@ public class CScope implements ICScope, IASTInternalScope {
return kind; return kind;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#getParent()
*/
@Override @Override
public IScope getParent() { public IScope getParent() {
return CVisitor.getContainingScope(physicalNode); return CVisitor.getContainingScope(physicalNode);
@ -135,12 +132,13 @@ public class CScope implements ICScope, IASTInternalScope {
protected static class CollectNamesAction extends ASTVisitor { protected static class CollectNamesAction extends ASTVisitor {
private final char[] name; private final char[] name;
private IASTName[] result = null; private IASTName[] result;
CollectNamesAction(char[] n) { CollectNamesAction(char[] n) {
name = n; name = n;
shouldVisitNames = true; shouldVisitNames = true;
} }
@Override @Override
public int visit(IASTName n) { public int visit(IASTName n) {
ASTNodeProperty prop = n.getPropertyInParent(); ASTNodeProperty prop = n.getPropertyInParent();
@ -166,9 +164,6 @@ public class CScope implements ICScope, IASTInternalScope {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
*/
@Override @Override
public IBinding[] find(String name) { public IBinding[] find(String name) {
return CVisitor.findBindings(this, name); return CVisitor.findBindings(this, name);
@ -188,9 +183,6 @@ public class CScope implements ICScope, IASTInternalScope {
return null; return null;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#getPhysicalNode()
*/
@Override @Override
public IASTNode getPhysicalNode() { public IASTNode getPhysicalNode() {
return physicalNode; return physicalNode;
@ -240,6 +232,7 @@ public class CScope implements ICScope, IASTInternalScope {
return NAMESPACE_TYPE_OTHER; return NAMESPACE_TYPE_OTHER;
} }
@Override @Override
public final IBinding getBinding(IASTName name, boolean resolve) { public final IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, IIndexFileSet.EMPTY); return getBinding(name, resolve, IIndexFileSet.EMPTY);
@ -289,8 +282,8 @@ public class CScope implements ICScope, IASTInternalScope {
bindings= fileSet.filterFileLocalBindings(bindings); bindings= fileSet.filterFileLocalBindings(bindings);
} }
result= processIndexResults(name, bindings); result= processIndexResults(name, bindings);
} catch(CoreException ce) { } catch (CoreException e) {
CCorePlugin.log(ce); CCorePlugin.log(e);
} }
} }
} }
@ -329,9 +322,6 @@ public class CScope implements ICScope, IASTInternalScope {
return true; return true;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.c.ICScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
*/
/** /**
* @deprecated Use {@link #getBindings(ScopeLookupData)} instead * @deprecated Use {@link #getBindings(ScopeLookupData)} instead
*/ */
@ -341,9 +331,6 @@ public class CScope implements ICScope, IASTInternalScope {
return getBindings(new ScopeLookupData(name, resolve, prefixLookup)); return getBindings(new ScopeLookupData(name, resolve, prefixLookup));
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.c.ICScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
*/
@Override @Override
public final IBinding[] getBindings(ScopeLookupData lookup) { public final IBinding[] getBindings(ScopeLookupData lookup) {
char[] c = lookup.getLookupKey(); char[] c = lookup.getLookupKey();
@ -517,8 +504,7 @@ public class CScope implements ICScope, IASTInternalScope {
node = null; node = null;
if (nodes[0].getPropertyInParent() == ICASTKnRFunctionDeclarator.FUNCTION_PARAMETER if (nodes[0].getPropertyInParent() == ICASTKnRFunctionDeclarator.FUNCTION_PARAMETER
|| nodes[0].getPropertyInParent() == IASTStandardFunctionDeclarator.FUNCTION_PARAMETER) { || nodes[0].getPropertyInParent() == IASTStandardFunctionDeclarator.FUNCTION_PARAMETER) {
// function body, we were looking at parameters, now // Function body, we were looking at parameters, now check the body itself.
// check the body itself
IASTCompoundStatement compound = null; IASTCompoundStatement compound = null;
if (scopeNode instanceof IASTCompoundStatement) { if (scopeNode instanceof IASTCompoundStatement) {
compound = (IASTCompoundStatement) scopeNode; compound = (IASTCompoundStatement) scopeNode;
@ -604,7 +590,7 @@ public class CScope implements ICScope, IASTInternalScope {
tempName = ((ICASTCompositeTypeSpecifier)declSpec).getName(); tempName = ((ICASTCompositeTypeSpecifier)declSpec).getName();
ASTInternal.addName(this, tempName); ASTInternal.addName(this, tempName);
//also have to check for any nested structs // Also have to check for any nested structs.
IASTDeclaration[] nested = ((ICASTCompositeTypeSpecifier)declSpec).getMembers(); IASTDeclaration[] nested = ((ICASTCompositeTypeSpecifier)declSpec).getMembers();
for (IASTDeclaration element : nested) { for (IASTDeclaration element : nested) {
if (element instanceof IASTSimpleDeclaration) { if (element instanceof IASTSimpleDeclaration) {
@ -619,7 +605,7 @@ public class CScope implements ICScope, IASTInternalScope {
tempName = enumeration.getName(); tempName = enumeration.getName();
ASTInternal.addName(this, tempName); ASTInternal.addName(this, tempName);
//check enumerators // Check enumerators.
IASTEnumerator[] list = ((ICASTEnumerationSpecifier) declSpec).getEnumerators(); IASTEnumerator[] list = ((ICASTEnumerationSpecifier) declSpec).getEnumerators();
for (IASTEnumerator enumerator : list) { for (IASTEnumerator enumerator : list) {
if (enumerator == null) break; if (enumerator == null) break;
@ -629,9 +615,6 @@ public class CScope implements ICScope, IASTInternalScope {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#getScopeName()
*/
@Override @Override
public IName getScopeName() { public IName getScopeName() {
if (physicalNode instanceof IASTCompositeTypeSpecifier) { if (physicalNode instanceof IASTCompositeTypeSpecifier) {