mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Bug Fixing
This commit is contained in:
parent
f558f2708d
commit
6ffa80bd87
8 changed files with 49 additions and 10 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2004-06-10 Hoda Amer
|
||||||
|
Fix for PR 65970: [Outline View] Contents of Includes displayed in Outline for STRUCTURAL_PARSE mode
|
||||||
|
|
||||||
2004-06-09 Alain Magloire
|
2004-06-09 Alain Magloire
|
||||||
|
|
||||||
Patch from Sam Rob to resolve 64022
|
Patch from Sam Rob to resolve 64022
|
||||||
|
|
|
@ -57,6 +57,9 @@ public class StructuralParseCallback extends QuickParseCallback{
|
||||||
|
|
||||||
private void enterScope(IASTNode node){
|
private void enterScope(IASTNode node){
|
||||||
if(node instanceof IASTScope){
|
if(node instanceof IASTScope){
|
||||||
|
if(node instanceof ASTScope){
|
||||||
|
((ASTScope)node).initDeclarations();
|
||||||
|
}
|
||||||
pushScope((IASTScope)node);
|
pushScope((IASTScope)node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.eclipse.cdt.internal.core.parser.pst.IDerivableContainerSymbol.IParen
|
||||||
*/
|
*/
|
||||||
public class ASTClassSpecifier extends ASTScope implements IASTClassSpecifier
|
public class ASTClassSpecifier extends ASTScope implements IASTClassSpecifier
|
||||||
{
|
{
|
||||||
private List declarations = new ArrayList();
|
private List declarations = null;
|
||||||
public class BaseIterator implements Iterator
|
public class BaseIterator implements Iterator
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ public class ASTClassSpecifier extends ASTScope implements IASTClassSpecifier
|
||||||
//If a callback (ie StructuralParseCallback) populates the declarations list
|
//If a callback (ie StructuralParseCallback) populates the declarations list
|
||||||
//then return that iterator, otherwise use the ASTScope implementation which
|
//then return that iterator, otherwise use the ASTScope implementation which
|
||||||
//gets one from the symbol table.
|
//gets one from the symbol table.
|
||||||
if( !declarations.isEmpty() ){
|
if( declarations != null ){
|
||||||
return declarations.iterator();
|
return declarations.iterator();
|
||||||
}
|
}
|
||||||
return super.getDeclarations();
|
return super.getDeclarations();
|
||||||
|
@ -282,6 +282,12 @@ public class ASTClassSpecifier extends ASTScope implements IASTClassSpecifier
|
||||||
declarations.add(declaration);
|
declarations.add(declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void initDeclarations()
|
||||||
|
{
|
||||||
|
declarations = new ArrayList(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
|
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol;
|
||||||
*/
|
*/
|
||||||
public class ASTCodeScope extends ASTScope implements IASTCodeScope {
|
public class ASTCodeScope extends ASTScope implements IASTCodeScope {
|
||||||
|
|
||||||
private List declarations = new ArrayList();
|
private List declarations = null;
|
||||||
private final IASTCodeScope ownerCodeScope;
|
private final IASTCodeScope ownerCodeScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,13 +80,20 @@ public class ASTCodeScope extends ASTScope implements IASTCodeScope {
|
||||||
|
|
||||||
public Iterator getDeclarations()
|
public Iterator getDeclarations()
|
||||||
{
|
{
|
||||||
|
if(declarations != null)
|
||||||
return declarations.iterator();
|
return declarations.iterator();
|
||||||
|
else
|
||||||
|
return super.getDeclarations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDeclaration(IASTDeclaration declaration)
|
public void addDeclaration(IASTDeclaration declaration)
|
||||||
{
|
{
|
||||||
declarations.add(declaration);
|
declarations.add(declaration);
|
||||||
}
|
}
|
||||||
|
public void initDeclarations()
|
||||||
|
{
|
||||||
|
declarations = new ArrayList(0);
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getContainingFunction()
|
* @see org.eclipse.cdt.core.parser.ast.IASTCodeScope#getContainingFunction()
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class ASTCompilationUnit
|
||||||
extends ASTScope
|
extends ASTScope
|
||||||
implements IASTCompilationUnit
|
implements IASTCompilationUnit
|
||||||
{
|
{
|
||||||
private List declarations = new ArrayList();
|
private List declarations = null;
|
||||||
/**
|
/**
|
||||||
* @param symbol
|
* @param symbol
|
||||||
*/
|
*/
|
||||||
|
@ -77,7 +77,7 @@ public class ASTCompilationUnit
|
||||||
//If a callback (ie StructuralParseCallback) populates the declarations list
|
//If a callback (ie StructuralParseCallback) populates the declarations list
|
||||||
//then return that iterator, otherwise use the ASTScope implementation which
|
//then return that iterator, otherwise use the ASTScope implementation which
|
||||||
//gets one from the symbol table.
|
//gets one from the symbol table.
|
||||||
if( !declarations.isEmpty() )
|
if( declarations != null )
|
||||||
return declarations.iterator();
|
return declarations.iterator();
|
||||||
|
|
||||||
return super.getDeclarations();
|
return super.getDeclarations();
|
||||||
|
@ -87,4 +87,8 @@ public class ASTCompilationUnit
|
||||||
{
|
{
|
||||||
declarations.add(declaration);
|
declarations.add(declaration);
|
||||||
}
|
}
|
||||||
|
public void initDeclarations()
|
||||||
|
{
|
||||||
|
declarations = new ArrayList(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class ASTFunction extends ASTScope implements IASTFunction
|
||||||
private final ASTQualifiedNamedElement qualifiedName;
|
private final ASTQualifiedNamedElement qualifiedName;
|
||||||
private final List parameters;
|
private final List parameters;
|
||||||
protected List references;
|
protected List references;
|
||||||
private List declarations = new ArrayList();
|
private List declarations = null;
|
||||||
/**
|
/**
|
||||||
* @param symbol
|
* @param symbol
|
||||||
* @param parameters
|
* @param parameters
|
||||||
|
@ -328,12 +328,20 @@ public class ASTFunction extends ASTScope implements IASTFunction
|
||||||
|
|
||||||
public Iterator getDeclarations()
|
public Iterator getDeclarations()
|
||||||
{
|
{
|
||||||
|
if(declarations != null)
|
||||||
return declarations.iterator();
|
return declarations.iterator();
|
||||||
|
else
|
||||||
|
return super.getDeclarations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDeclaration(IASTDeclaration declaration)
|
public void addDeclaration(IASTDeclaration declaration)
|
||||||
{
|
{
|
||||||
declarations.add(declaration);
|
declarations.add(declaration);
|
||||||
}
|
}
|
||||||
|
public void initDeclarations()
|
||||||
|
{
|
||||||
|
declarations = new ArrayList(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class ASTNamespaceDefinition
|
||||||
|
|
||||||
private NamedOffsets offsets = new NamedOffsets();
|
private NamedOffsets offsets = new NamedOffsets();
|
||||||
private final ASTQualifiedNamedElement qualifiedName;
|
private final ASTQualifiedNamedElement qualifiedName;
|
||||||
private List declarations = new ArrayList();
|
private List declarations = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param namespaceSymbol
|
* @param namespaceSymbol
|
||||||
|
@ -171,7 +171,7 @@ public class ASTNamespaceDefinition
|
||||||
//If a callback (ie StructuralParseCallback) populates the declarations list
|
//If a callback (ie StructuralParseCallback) populates the declarations list
|
||||||
//then return that iterator, otherwise use the ASTScope implementation which
|
//then return that iterator, otherwise use the ASTScope implementation which
|
||||||
//gets one from the symbol table.
|
//gets one from the symbol table.
|
||||||
if( !declarations.isEmpty() )
|
if( declarations != null )
|
||||||
return declarations.iterator();
|
return declarations.iterator();
|
||||||
|
|
||||||
return super.getDeclarations();
|
return super.getDeclarations();
|
||||||
|
@ -181,6 +181,11 @@ public class ASTNamespaceDefinition
|
||||||
declarations.add(declaration);
|
declarations.add(declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void initDeclarations()
|
||||||
|
{
|
||||||
|
declarations = new ArrayList(0);
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
|
* @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -52,4 +52,7 @@ public abstract class ASTScope extends ASTSymbol implements IASTScope
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void initDeclarations()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue