Package com.redhat.ceylon.compiler.typechecker.model

Examples of com.redhat.ceylon.compiler.typechecker.model.Modules


        packageStack.clear();
        currentModule = null;
       
        modules = context.getModules();
        if ( modules == null ) {
            modules = new Modules();
            context.setModules(modules);
            //build empty package
            final Package emptyPackage = createPackage("", null);
            packageStack.addLast(emptyPackage);
View Full Code Here


            @Override
            public void finished(TaskEvent e) {
                if(e.getKind() == Kind.ENTER){
                    AbstractModelLoader modelLoader = CeylonModelLoader.instance(context2);
                    Modules modules = LanguageCompiler.getCeylonContextInstance(context2).getModules();
                    // now see if we can find our declarations
                    compareDeclarations(modelCompare, decls, modelLoader, modules);
                }
            }
        }
        Listener listener = new Listener();
        task2.setTaskListener(listener);

        success = task2.call();
        Assert.assertTrue("Compilation failed", success);
       
        // now check with the runtime model loader too
        String module = moduleForJavaModelLoading();
        String version = "1";
        ModuleWithArtifact moduleWithArtifact = new ModuleWithArtifact(module, version);
        synchronized(RUN_LOCK){
            // this initialises the metamodel, even if we don't use the resulting ClassLoader
            URLClassLoader classLoader;
            try {
                classLoader = getClassLoader("runtime model loader tests", moduleWithArtifact);
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
            }
            try{
                RuntimeModuleManager moduleManager = Metamodel.getModuleManager();
                RuntimeModelLoader modelLoader = moduleManager.getModelLoader();
                Modules modules = moduleManager.getContext().getModules();
                // now see if we can find our declarations
                compareDeclarations(modelCompare, decls, modelLoader, modules);
            }finally{
                try {
                    classLoader.close();
View Full Code Here

            @Override
            public void finished(TaskEvent e) {
                if(e.getKind() == Kind.ENTER){
                    AbstractModelLoader modelLoader = CeylonModelLoader.instance(context2);
                    Modules modules = LanguageCompiler.getCeylonContextInstance(context2).getModules();
                    // now see if we can find our declarations
                    compareDeclarations(modelCompare, decls, modelLoader, modules);
                }
            }
View Full Code Here

        return trees;
    }

    private void loadCompiledModules(List<JCCompilationUnit> trees, LinkedList<JCCompilationUnit> moduleTrees) {
        compilerDelegate.visitModules(phasedUnits);
        Modules modules = ceylonContext.getModules();
        // now make sure the phase units have their modules and packages set correctly
        for (PhasedUnit pu : phasedUnits.getPhasedUnits()) {
            Package pkg = pu.getPackage();
            loadModuleFromSource(pkg, modules, moduleTrees, trees);
        }
View Full Code Here

    }

    @Override
    public void initCoreModules() {
        super.initCoreModules();
        Modules modules = getContext().getModules();
        // FIXME: this should go away somewhere else, but we need it to be set otherwise
        // when we load the module from compiled sources, ModuleManager.getOrCreateModule() will not
        // return the language module because its version is null
        Module languageModule = modules.getLanguageModule();
        languageModule.setVersion(TypeChecker.LANGUAGE_MODULE_VERSION);
    }
View Full Code Here

    }
   
    @Override
    public AbstractModelLoader getModelLoader() {
        if(modelLoader == null){
            Modules modules = getContext().getModules();
            modelLoader = createModelLoader(modules);           
        }
        return modelLoader;
    }
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.typechecker.model.Modules

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.