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

Updated PDOM to be able to handle Mozilla.

This commit is contained in:
Doug Schaefer 2005-10-21 17:36:48 +00:00
parent b3913875ff
commit d9f748b48c
4 changed files with 14 additions and 7 deletions

View file

@ -118,11 +118,14 @@ public class CParameter implements IParameter {
return ((IASTCompoundStatement)((IASTFunctionDefinition)parent).getBody()).getScope();
}
IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) parent.getParent().getParent();
parent = fdtor.getParent();
if( parent instanceof IASTFunctionDefinition ) {
return ((IASTCompoundStatement)((IASTFunctionDefinition)parent).getBody()).getScope();
}
IASTNode fdtorNode = parent.getParent().getParent();
if (fdtorNode instanceof IASTFunctionDeclarator) {
IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator)fdtorNode;
parent = fdtor.getParent();
if( parent instanceof IASTFunctionDefinition ) {
return ((IASTCompoundStatement)((IASTFunctionDefinition)parent).getBody()).getScope();
}
}
}
//TODO: if not definition, find definition
return null;

View file

@ -53,7 +53,9 @@ public class CPPArrayType implements IArrayType, ITypeContainer {
if( obj instanceof IArrayType ){
try {
return ((IArrayType) obj).getType().isSameType( type );
IType objType = ((IArrayType)obj).getType();
if (objType != null)
return objType.isSameType( type );
} catch ( DOMException e ) {
return false;
}

View file

@ -76,7 +76,7 @@ public class CPPFunctionType implements ICPPFunctionType {
return false;
} else {
for( int i = 0; i < parameters.length; i++ ){
if( ! parameters[i].isSameType( fps[i] ) )
if (parameters[i] == null || ! parameters[i].isSameType( fps[i] ) )
return false;
}
}

View file

@ -615,6 +615,8 @@ public class CPPVisitor {
} catch ( DOMException e ) {
return false;
}
if (clsTypeSpec == null)
return false;
IASTName clsName = clsTypeSpec.getName();
if( clsName instanceof ICPPASTQualifiedName ){
IASTName [] names = ((ICPPASTQualifiedName)clsName).getNames();