Package com.redhat.ceylon.compiler.typechecker.analyzer

Examples of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager


    private List<String> moduleFilters;
    private String encoding;

    public PhasedUnits(Context context) {
        this.context = context;
        this.moduleManager = new ModuleManager(context);
        this.moduleManager.initCoreModules();
    }
View Full Code Here


    public PhasedUnits(Context context, ModuleManagerFactory moduleManagerFactory) {
        this.context = context;
        if(moduleManagerFactory != null){
            this.moduleManager = moduleManagerFactory.createModuleManager(context);
        }else{
            this.moduleManager = new ModuleManager(context);
        }
        this.moduleManager.initCoreModules();
    }
View Full Code Here

                public void visit(ModuleDescriptor that) {
                    super.visit(that);
                    ImportPath importPath = that.getImportPath();
                    if (importPath != null) {
                        String moduleName = Util.formatPath(importPath.getIdentifiers());
                        ModuleManager moduleManager = moduleManagerRef.get();
                        if (moduleManager != null) {
                            for (Module otherModule : moduleManager.getCompiledModules()) {
                                String otherModuleName = otherModule.getNameAsString();
                                if (moduleName.startsWith(otherModuleName + ".") ||
                                        otherModuleName.startsWith(moduleName + ".")) {
                                    StringBuilder error = new StringBuilder("Found two modules within the same hierarchy: '");
                                    error.append( otherModule.getNameAsString() )
View Full Code Here

        RepositoryManager repoManager = builder.buildRepository();
        VFS vfs = new VFS();
        Context context = new Context(repoManager, vfs);
        PhasedUnits pus = new PhasedUnits(context);
        List<String> name = ModuleManager.splitModuleName(moduleName);
        ModuleManager moduleManager = pus.getModuleManager();
        if(Module.DEFAULT_MODULE_NAME.equals(moduleName)){
            // visit every folder and skip modules
            boolean exists = findDefaultModuleSource(srcDir);
            if(!exists)
                throw new NoSuchModuleException("No source found for default module");
        }else{
            visitModule(vfs, pus, name, srcDir, vfs.getFromFile(srcDir), moduleManager);
        }
        for (PhasedUnit pu : pus.getPhasedUnits()) {
            pu.visitSrcModulePhase();
        }
        this.moduleDescriptor = moduleManager.getOrCreateModule(name, null);
    }
View Full Code Here

   
    private JCCompilationUnit ceylonParse(JavaFileObject filename, CharSequence readSource) {
        if(ceylonEnter.hasRun())
            throw new RunTwiceException("Trying to load new source file after CeylonEnter has been called: "+filename);
        try {
            ModuleManager moduleManager = phasedUnits.getModuleManager();
            File sourceFile = new File(filename.getName());
            // FIXME: temporary solution
            VirtualFile file = vfs.getFromFile(sourceFile);
            VirtualFile srcDir = vfs.getFromFile(getSrcDir(sourceFile));
           
View Full Code Here

                }
            }else{
                // there was a syntax error in the module descriptor, make a pretend module so that we can
                // correctly mark all declarations as part of that module, but we won't generate any code
                // for it
                ModuleManager moduleManager = phasedUnits.getModuleManager();
                module = moduleManager.getOrCreateModule(Arrays.asList(pkgName.split("\\.")), "bogus");
            }
            // now remember it
            if(module != null){
                modulesLoadedFromSource.add(module);
                return module;
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager

Copyright © 2018 www.massapicom. 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.