Search in sources :

Example 1 with SelfReferenceVisitor

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

the class PhasedUnit method analyseFlow.

public synchronized void analyseFlow() {
    if (!flowAnalyzed) {
        rootNode.visit(new TypeHierarchyVisitor().setExceptionHandler(this));
        // System.out.println("Validate control flow for " + fileName);
        rootNode.visit(new ControlFlowVisitor().setExceptionHandler(this));
        // System.out.println("Validate specification for " + fileName);
        for (Declaration d : unit.getDeclarations()) {
            if (d.getName() != null || d instanceof Constructor) {
                rootNode.visit(new SpecificationVisitor(d).setExceptionHandler(this));
                if (d instanceof TypeDeclaration) {
                    TypeDeclaration td = (TypeDeclaration) d;
                    rootNode.visit(new SelfReferenceVisitor(td).setExceptionHandler(this));
                }
            }
        }
        flowAnalyzed = true;
    }
}
Also used : SpecificationVisitor(org.eclipse.ceylon.compiler.typechecker.analyzer.SpecificationVisitor) Constructor(org.eclipse.ceylon.model.typechecker.model.Constructor) ControlFlowVisitor(org.eclipse.ceylon.compiler.typechecker.analyzer.ControlFlowVisitor) TypeDeclaration(org.eclipse.ceylon.model.typechecker.model.TypeDeclaration) Declaration(org.eclipse.ceylon.model.typechecker.model.Declaration) TypeDeclaration(org.eclipse.ceylon.model.typechecker.model.TypeDeclaration) SelfReferenceVisitor(org.eclipse.ceylon.compiler.typechecker.analyzer.SelfReferenceVisitor) TypeHierarchyVisitor(org.eclipse.ceylon.compiler.typechecker.analyzer.TypeHierarchyVisitor)

Aggregations

ControlFlowVisitor (org.eclipse.ceylon.compiler.typechecker.analyzer.ControlFlowVisitor)1 SelfReferenceVisitor (org.eclipse.ceylon.compiler.typechecker.analyzer.SelfReferenceVisitor)1 SpecificationVisitor (org.eclipse.ceylon.compiler.typechecker.analyzer.SpecificationVisitor)1 TypeHierarchyVisitor (org.eclipse.ceylon.compiler.typechecker.analyzer.TypeHierarchyVisitor)1 Constructor (org.eclipse.ceylon.model.typechecker.model.Constructor)1 Declaration (org.eclipse.ceylon.model.typechecker.model.Declaration)1 TypeDeclaration (org.eclipse.ceylon.model.typechecker.model.TypeDeclaration)1