1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2015-06-08 16:44:04 -07:00
parent 8c8d10f2e0
commit ff84cfc4a1
3 changed files with 26 additions and 23 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2012 IBM Corporation and others. * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -31,25 +31,21 @@ public interface IScope {
EScopeKind getKind(); EScopeKind getKind();
/** /**
* Returns the IName for this scope, may be null * Returns the IName for this scope, may be {@code null}
* @return The name of this scope. * @return The name of this scope.
*/ */
public IName getScopeName(); public IName getScopeName();
/** /**
* Returns the first enclosing non-template scope, or {@code null} if this * Returns the first enclosing non-template scope, or {@code null} if this is the global scope.
* is the global scope.
* <p>
* For scopes obtained from an index, {@code null} is returned to indicate that the
* scope is only enclosed by the global scope.
*/ */
public IScope getParent() throws DOMException; public IScope getParent() throws DOMException;
/** /**
* This is the general lookup entry point. It returns the list of * This is the general lookup entry point. It returns the list of valid bindings for a given
* valid bindings for a given name. The lookup proceeds as an unqualified * name. The lookup proceeds as an unqualified lookup. Constructors are not considered during
* lookup. Constructors are not considered during this lookup and won't be returned. * this lookup and won't be returned. No attempt is made to resolve potential ambiguities or
* No attempt is made to resolve potential ambiguities or perform access checking. * perform access checking.
* *
* @param name the name of the bindings * @param name the name of the bindings
* @return An array of bindings. * @return An array of bindings.
@ -59,11 +55,11 @@ public interface IScope {
/** /**
* Returns the binding in this scope that the given name would resolve to. Could * Returns the binding in this scope that the given name would resolve to. Could
* return null if there is no matching binding in this scope, if the binding has not * return null if there is no matching binding in this scope, if the binding has not
* yet been cached in this scope, or if resolve == false and the appropriate binding * yet been cached in this scope, or if resolve is {@code false} and the appropriate binding
* has not yet been resolved. * has not yet been resolved.
* *
* @param name the name of the binding * @param name the name of the binding
* @param resolve whether or not to resolve the matching binding if it has not been so already. * @param resolve whether or not to resolve the matching binding if it has not been so already
* @return the binding in this scope that matches the name, or {@code null} * @return the binding in this scope that matches the name, or {@code null}
*/ */
public IBinding getBinding(IASTName name, boolean resolve); public IBinding getBinding(IASTName name, boolean resolve);
@ -71,14 +67,14 @@ public interface IScope {
/** /**
* Returns the binding in this scope that the given name would resolve to. Could * Returns the binding in this scope that the given name would resolve to. Could
* return null if there is no matching binding in this scope, if the binding has not * return null if there is no matching binding in this scope, if the binding has not
* yet been cached in this scope, or if resolve == false and the appropriate binding * yet been cached in this scope, or if resolve is {@code false} and the appropriate binding
* has not yet been resolved. Accepts file local bindings from the index for the files * has not yet been resolved. Accepts file local bindings from the index for the files
* in the given set, only. * in the given set, only.
* *
* @param name the name of the binding * @param name the name of the binding
* @param resolve whether or not to resolve the matching binding if it has not been so already. * @param resolve whether or not to resolve the matching binding if it has not been so already
* @param acceptLocalBindings a set of files for which to accept local bindings. * @param acceptLocalBindings a set of files for which to accept local bindings
* @return the binding in this scope that matches the name, or null * @return the binding in this scope that matches the name, or @code null}
*/ */
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings); public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings);

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2012 IBM Corporation and others. * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -44,15 +44,15 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
public ICPPBase[] getBases(); public ICPPBase[] getBases();
/** /**
* Get fields is restated here just to point out that this method returns a list of ICPPField * The method is restated here just to point out that this method returns a list of ICPPField
* objects representing all fields, declared or inherited. * objects representing all fields, declared or inherited.
*/ */
@Override @Override
public IField[] getFields(); public IField[] getFields();
/** /**
* findField is restated here to point out that this method looks through the inheritance tree * The method is restated here to point out that this method looks through the inheritance tree
* of this class while looking for a field with the given name If no field is found, null is * of this class while looking for a field with the given name. If no field is found, {@code null} is
* returned, if the name is found to be ambiguous a IProblemBinding is returned. * returned, if the name is found to be ambiguous a IProblemBinding is returned.
* *
* @param name * @param name
@ -116,7 +116,7 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
public boolean isFinal(); public boolean isFinal();
/** /**
* Gets the access specifier of the {@code member}. * Returns the access specifier of the {@code member}.
* *
* @param member The binding of the member to get the visibility for. * @param member The binding of the member to get the visibility for.
* {@code member} must be a member of this class. * {@code member} must be a member of this class.

View file

@ -61,14 +61,17 @@ public class CPPScopeMapper {
fContainer= container; fContainer= container;
fNominated= inline; fNominated= inline;
} }
@Override @Override
public IScope getContainingScope() { public IScope getContainingScope() {
return fContainer; return fContainer;
} }
@Override @Override
public ICPPNamespaceScope getNominatedScope() throws DOMException { public ICPPNamespaceScope getNominatedScope() throws DOMException {
return fNominated; return fNominated;
} }
@Override @Override
public int getPointOfDeclaration() { public int getPointOfDeclaration() {
return 0; return 0;
@ -97,18 +100,22 @@ public class CPPScopeMapper {
public IBinding[] find(String name) { public IBinding[] find(String name) {
return fScope.find(name); return fScope.find(name);
} }
@Override @Override
public IBinding getBinding(IASTName name, boolean resolve) { public IBinding getBinding(IASTName name, boolean resolve) {
return fScope.getBinding(name, resolve); return fScope.getBinding(name, resolve);
} }
@Override @Override
public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings) { public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings) {
return fScope.getBinding(name, resolve, acceptLocalBindings); return fScope.getBinding(name, resolve, acceptLocalBindings);
} }
@Override @Deprecated @Override @Deprecated
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) { public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) {
return fScope.getBindings(name, resolve, prefixLookup); return fScope.getBindings(name, resolve, prefixLookup);
} }
@Override @Deprecated @Override @Deprecated
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings) { public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings) {
return getBindings(name, resolve, prefixLookup, acceptLocalBindings); return getBindings(name, resolve, prefixLookup, acceptLocalBindings);
@ -174,7 +181,7 @@ public class CPPScopeMapper {
@Override @Override
public ICPPInternalNamespaceScope[] getInlineNamespaces() { public ICPPInternalNamespaceScope[] getInlineNamespaces() {
// Obtain the inline namespaces from the index and map them to the ast // Obtain the inline namespaces from the index and map them to the AST.
ICPPNamespaceScope[] pre = fScope.getInlineNamespaces(); ICPPNamespaceScope[] pre = fScope.getInlineNamespaces();
if (pre.length == 0) if (pre.length == 0)
return ICPPInternalNamespaceScope.EMPTY_NAMESPACE_SCOPE_ARRAY; return ICPPInternalNamespaceScope.EMPTY_NAMESPACE_SCOPE_ARRAY;