Search in sources :

Example 11 with Initializer

use of org.eclipse.jdt.core.dom.Initializer in project flux by eclipse.

the class ScopeAnalyzer method addLocalDeclarations.

private boolean addLocalDeclarations(ASTNode node, int offset, int flags, IBindingRequestor requestor) {
    if (hasFlag(VARIABLES, flags) || hasFlag(TYPES, flags)) {
        BodyDeclaration declaration = ASTResolving.findParentBodyDeclaration(node);
        if (declaration instanceof MethodDeclaration || declaration instanceof Initializer || declaration instanceof FieldDeclaration) {
            ScopeAnalyzerVisitor visitor = new ScopeAnalyzerVisitor(offset, flags, requestor);
            declaration.accept(visitor);
            return visitor.fBreak;
        }
    }
    return false;
}
Also used : Initializer(org.eclipse.jdt.core.dom.Initializer) MethodDeclaration(org.eclipse.jdt.core.dom.MethodDeclaration) BodyDeclaration(org.eclipse.jdt.core.dom.BodyDeclaration) FieldDeclaration(org.eclipse.jdt.core.dom.FieldDeclaration)

Aggregations

Initializer (org.eclipse.jdt.core.dom.Initializer)11 BodyDeclaration (org.eclipse.jdt.core.dom.BodyDeclaration)10 MethodDeclaration (org.eclipse.jdt.core.dom.MethodDeclaration)9 ASTNode (org.eclipse.jdt.core.dom.ASTNode)7 FieldDeclaration (org.eclipse.jdt.core.dom.FieldDeclaration)7 AST (org.eclipse.jdt.core.dom.AST)4 Block (org.eclipse.jdt.core.dom.Block)4 Expression (org.eclipse.jdt.core.dom.Expression)4 VariableDeclarationFragment (org.eclipse.jdt.core.dom.VariableDeclarationFragment)4 Assignment (org.eclipse.jdt.core.dom.Assignment)3 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)3 SimpleName (org.eclipse.jdt.core.dom.SimpleName)3 Statement (org.eclipse.jdt.core.dom.Statement)3 VariableDeclarationExpression (org.eclipse.jdt.core.dom.VariableDeclarationExpression)3 ASTRewrite (org.eclipse.jdt.core.dom.rewrite.ASTRewrite)3 ArrayInitializer (org.eclipse.jdt.core.dom.ArrayInitializer)2 EnhancedForStatement (org.eclipse.jdt.core.dom.EnhancedForStatement)2 ExpressionStatement (org.eclipse.jdt.core.dom.ExpressionStatement)2 FieldAccess (org.eclipse.jdt.core.dom.FieldAccess)2 ForStatement (org.eclipse.jdt.core.dom.ForStatement)2