Search in sources :

Example 1 with LocalDeclarationVisitor

use of org.eclipse.ceylon.compiler.typechecker.analyzer.LocalDeclarationVisitor in project ceylon by eclipse.

the class PhasedUnit method scanDeclarations.

public void scanDeclarations() {
    Boolean enabled = TypeCache.setEnabled(false);
    try {
        if (!declarationsScanned) {
            processLiterals();
            scanningDeclarations = true;
            // System.out.println("Scan declarations for " + fileName);
            DeclarationVisitor dv = new DeclarationVisitor(unit) {

                @Override
                protected boolean shouldIgnoreOverload(Declaration overload, Declaration declaration) {
                    return PhasedUnit.this.shouldIgnoreOverload(overload, declaration);
                }

                @Override
                protected boolean isAllowedToChangeModel(Declaration declaration) {
                    return PhasedUnit.this.isAllowedToChangeModel(declaration);
                }
            };
            rootNode.visit(dv.setExceptionHandler(this));
            rootNode.visit(new LocalDeclarationVisitor().setExceptionHandler(this));
            declarationsScanned = true;
            scanningDeclarations = false;
        }
    } finally {
        TypeCache.setEnabled(enabled);
    }
}
Also used : LocalDeclarationVisitor(org.eclipse.ceylon.compiler.typechecker.analyzer.LocalDeclarationVisitor) TypeDeclaration(org.eclipse.ceylon.model.typechecker.model.TypeDeclaration) Declaration(org.eclipse.ceylon.model.typechecker.model.Declaration) LocalDeclarationVisitor(org.eclipse.ceylon.compiler.typechecker.analyzer.LocalDeclarationVisitor) DeclarationVisitor(org.eclipse.ceylon.compiler.typechecker.analyzer.DeclarationVisitor)

Aggregations

DeclarationVisitor (org.eclipse.ceylon.compiler.typechecker.analyzer.DeclarationVisitor)1 LocalDeclarationVisitor (org.eclipse.ceylon.compiler.typechecker.analyzer.LocalDeclarationVisitor)1 Declaration (org.eclipse.ceylon.model.typechecker.model.Declaration)1 TypeDeclaration (org.eclipse.ceylon.model.typechecker.model.TypeDeclaration)1