1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

bug 89039

This commit is contained in:
Andrew Niefer 2005-03-29 16:25:09 +00:00
parent 50a283a448
commit f8da9f5f4e
4 changed files with 25 additions and 7 deletions

View file

@ -18,6 +18,13 @@ package org.eclipse.cdt.core.dom.ast;
public interface IScope { 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 * Scopes are arranged hierarchically. Lookups will generally
* flow upward to find resolution. * flow upward to find resolution.
* *

View file

@ -26,13 +26,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
*/ */
public interface ICPPScope extends 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 * Add an IASTName to be cached in this scope
* *

View file

@ -17,6 +17,7 @@ package org.eclipse.cdt.internal.core.dom.parser;
import java.text.MessageFormat; import java.text.MessageFormat;
import org.eclipse.cdt.core.dom.ast.DOMException; 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.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding; 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 { public IBinding[] find( String name ) throws DOMException {
throw new DOMException( this ); throw new DOMException( this );
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#getScopeName()
*/
public IASTName getScopeName() throws DOMException {
return null;
}
} }

View file

@ -207,4 +207,14 @@ public class CScope implements ICScope {
public boolean isFullyCached(){ public boolean isFullyCached(){
return 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;
}
} }