Examples of PhasedUnit


Examples of com.redhat.ceylon.compiler.typechecker.context.PhasedUnit

            // we really want to compile.
            for(JCCompilationUnit parsedTree : parsedTrees){
                if(parsedTree.sourcefile.equals(fileObject)
                        && parsedTree instanceof CeylonCompilationUnit){
                    // same file! we already parsed it, let's return this one's module
                    PhasedUnit phasedUnit = ((CeylonCompilationUnit)parsedTree).phasedUnit;
                    // the module visitor does load the module but does not set the unit's package module
                    if(phasedUnit.getPackage().getModule() == null){
                        // so find the module it created
                        for(Module mod : ceylonContext.getModules().getListOfModules()){
                            // we recognise it with the unit
                            if(mod.getUnit() == phasedUnit.getUnit()){
                                // set the package's module
                                Package pkg = phasedUnit.getPackage();
                                pkg.setModule(mod);
                                mod.getPackages().add(pkg);
                                modulesLoadedFromSource.add(mod);
                                break;
                            }
                        }
                    }
                    // now return it
                    return phasedUnit.getPackage().getModule();
                }
            }
            JCCompilationUnit javaCompilationUnit = parse(fileObject);
            Module module;
            if(javaCompilationUnit instanceof CeylonCompilationUnit){
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.context.PhasedUnit

        // even though there's no module descriptor
        pus.getModuleManager().push(PKGNAME);
        pus.parseUnit(vfs.getFromFile(file), vfs.getFromFile(new File("test-src")));
        final java.util.List<PhasedUnit> listOfUnits = pus.getPhasedUnits();
       
        PhasedUnit pu = listOfUnits.get(0);
        pu.validateTree();
        pu.scanDeclarations();
        
        pu.scanTypeDeclarations();
        
        pu.validateRefinement();
        
        pu.analyseTypes();
        
        pu.analyseFlow();
        return pu.getDeclarations();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.