mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 17:25:38 +02:00
Add IASTFunction.setHasFunctionBody()/IASTFunction.getHasFunctionBody()
for the sake of the outline view.
This commit is contained in:
parent
4da2df9363
commit
1db528a01b
3 changed files with 36 additions and 2 deletions
|
@ -26,6 +26,11 @@ public interface IASTFunction extends IASTScope, IASTOffsetableNamedElement, IAS
|
||||||
|
|
||||||
public IASTAbstractDeclaration getReturnType();
|
public IASTAbstractDeclaration getReturnType();
|
||||||
public Iterator getParameters();
|
public Iterator getParameters();
|
||||||
public IASTExceptionSpecification getExceptionSpec();
|
public IASTExceptionSpecification getExceptionSpec();
|
||||||
|
/**
|
||||||
|
* @param b
|
||||||
|
*/
|
||||||
|
public void setHasFunctionBody(boolean b);
|
||||||
|
public boolean hasFunctionBody();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,10 @@ import java.util.NoSuchElementException;
|
||||||
import org.eclipse.cdt.core.parser.IQuickParseCallback;
|
import org.eclipse.cdt.core.parser.IQuickParseCallback;
|
||||||
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
|
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
|
import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
|
||||||
|
import org.eclipse.cdt.core.parser.ast.IASTFunction;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTMacro;
|
import org.eclipse.cdt.core.parser.ast.IASTMacro;
|
||||||
|
import org.eclipse.cdt.core.parser.ast.IASTMethod;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement;
|
import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement;
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +41,20 @@ public class QuickParseCallback extends NullSourceElementRequestor implements IQ
|
||||||
return macros.iterator();
|
return macros.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void exitMethodBody( IASTMethod method )
|
||||||
|
{
|
||||||
|
method.setHasFunctionBody( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void exitFunctionBody( IASTFunction function )
|
||||||
|
{
|
||||||
|
function.setHasFunctionBody( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void exitCompilationUnit( IASTCompilationUnit compilationUnit )
|
public void exitCompilationUnit( IASTCompilationUnit compilationUnit )
|
||||||
{
|
{
|
||||||
this.compilationUnit = compilationUnit;
|
this.compilationUnit = compilationUnit;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.cdt.core.parser.ast.IASTFunction;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement;
|
import org.eclipse.cdt.core.parser.ast.IASTQualifiedNameElement;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTScope;
|
import org.eclipse.cdt.core.parser.ast.IASTScope;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
|
import org.eclipse.cdt.core.parser.ast.IASTTemplate;
|
||||||
import org.eclipse.cdt.internal.core.parser.ast.*;
|
import org.eclipse.cdt.internal.core.parser.ast.ASTQualifiedNamedElement;
|
||||||
import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
|
import org.eclipse.cdt.internal.core.parser.ast.NamedOffsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,6 +52,7 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction
|
||||||
qualifiedName = new ASTQualifiedNamedElement( scope, name );
|
qualifiedName = new ASTQualifiedNamedElement( scope, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasFunctionBody = false;
|
||||||
private final IASTQualifiedNameElement qualifiedName;
|
private final IASTQualifiedNameElement qualifiedName;
|
||||||
private final IASTTemplate ownerTemplateDeclaration;
|
private final IASTTemplate ownerTemplateDeclaration;
|
||||||
private NamedOffsets offsets = new NamedOffsets();
|
private NamedOffsets offsets = new NamedOffsets();
|
||||||
|
@ -198,4 +199,16 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction
|
||||||
{
|
{
|
||||||
requestor.exitFunctionBody( this );
|
requestor.exitFunctionBody( this );
|
||||||
}
|
}
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionBody(boolean)
|
||||||
|
*/
|
||||||
|
public void setHasFunctionBody(boolean b) {
|
||||||
|
hasFunctionBody = true;
|
||||||
|
}
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.core.parser.ast.IASTFunction#hasFunctionBody()
|
||||||
|
*/
|
||||||
|
public boolean hasFunctionBody() {
|
||||||
|
return hasFunctionBody;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue