mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
bug 89039
This commit is contained in:
parent
50a283a448
commit
f8da9f5f4e
4 changed files with 25 additions and 7 deletions
|
@ -18,6 +18,13 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
public interface IScope {
|
||||
|
||||
/**
|
||||
* Get the IASTName for this scope, may be null
|
||||
* @return
|
||||
* @throws DOMException
|
||||
*/
|
||||
public IASTName getScopeName() throws DOMException;
|
||||
|
||||
/**
|
||||
* Scopes are arranged hierarchically. Lookups will generally
|
||||
* flow upward to find resolution.
|
||||
*
|
||||
|
|
|
@ -26,13 +26,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
|
|||
*/
|
||||
public interface ICPPScope extends IScope {
|
||||
|
||||
/**
|
||||
* Get the name for this scope, may be null
|
||||
* @return
|
||||
* @throws DOMException
|
||||
*/
|
||||
public IASTName getScopeName() throws DOMException;
|
||||
|
||||
/**
|
||||
* Add an IASTName to be cached in this scope
|
||||
*
|
||||
|
|
|
@ -17,6 +17,7 @@ package org.eclipse.cdt.internal.core.dom.parser;
|
|||
import java.text.MessageFormat;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
|
@ -129,4 +130,11 @@ public class ProblemBinding implements IProblemBinding, IType, IScope {
|
|||
public IBinding[] find( String name ) throws DOMException {
|
||||
throw new DOMException( this );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getScopeName()
|
||||
*/
|
||||
public IASTName getScopeName() throws DOMException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -207,4 +207,14 @@ public class CScope implements ICScope {
|
|||
public boolean isFullyCached(){
|
||||
return isFullyCached;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IScope#getScopeName()
|
||||
*/
|
||||
public IASTName getScopeName() throws DOMException {
|
||||
if( physicalNode instanceof IASTCompositeTypeSpecifier ){
|
||||
return ((IASTCompositeTypeSpecifier) physicalNode).getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue