Example usage for org.eclipse.jdt.internal.compiler.ast TypeDeclaration analyseCode

List of usage examples for org.eclipse.jdt.internal.compiler.ast TypeDeclaration analyseCode

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast TypeDeclaration analyseCode.

Prototype

public void analyseCode(CompilationUnitScope unitScope) 

Source Link

Document

Flow analysis for a package member type

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies.java

License:Open Source License

private static boolean ensureLateRoleUnitState(RoleModel model, int nextState) {
    // a unit-state has been requested for a late role
    TypeDeclaration roleDecl = model.getAst();
    if (roleDecl != null) {
        TypeDeclaration teamDecl = roleDecl.enclosingType;
        switch (nextState) {
        case STATE_ROLE_FILES_LINKED: // handled explicitly when role files are found
            break;
        case STATE_LENV_DONE_FIELDS_AND_METHODS:
            if (roleDecl.scope != null) {
                roleDecl.scope.checkParameterizedTypeBounds();
                roleDecl.scope.checkParameterizedSuperTypeCollisions();
                if (Config.getBuildFieldsAndMethods())
                    roleDecl.scope.buildFieldsAndMethodsForLateRole();
            }//from   www .j a  va2  s  . com
            break;
        case STATE_RESOLVED:
            if (teamDecl != null && teamDecl.scope != null)
                roleDecl.resolve(teamDecl.scope);
            break;
        case STATE_CODE_ANALYZED:
            if (teamDecl != null && teamDecl.scope != null)
                if (Config.getAnalyzeCode())
                    roleDecl.analyseCode(teamDecl.scope);
            break;
        default:
            if (roleDecl.isRoleFile()) {
                CompilationUnitDeclaration unit = roleDecl.compilationUnit;
                Pair<Boolean, Success> result = establishUnitState(unit, nextState, Success.OK, null);
                Success success = result.second;
                if (success != Success.NotReady)
                    StateHelper.setStateRecursive(unit, nextState, false);
                return success == Success.OK;
            }
        }
    }
    model.setState(nextState);
    model.setMemberState(nextState);
    return true;
}