Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleSourceDefinitionGroup


        SourceModel.ModuleDefn moduleDefn2 = SourceModel.ModuleDefn.make(moduleNames[1], new SourceModel.Import[] { SourceModel.Import.make(CAL_Prelude.MODULE_NAME) }, null);
        ModuleSourceDefinition moduleSourceDefn2 = new SourceModelModuleSource(moduleDefn2);
       
        ModuleSourceDefinition[] moduleSourceDefns = { moduleSourceDefn1, moduleSourceDefn2 };
       
        ModuleSourceDefinitionGroup mdg = new ModuleSourceDefinitionGroup(moduleSourceDefns);

        try {
            CompilerMessageLogger logger = new MessageLogger();
            Severity severity = workspaceManager.makeModules(moduleNames, mdg, logger);
           
View Full Code Here


        SourceModel.ModuleDefn moduleDefn2 = SourceModel.ModuleDefn.make(moduleNames[1], new SourceModel.Import[] { SourceModel.Import.make(CAL_Prelude.MODULE_NAME), SourceModel.Import.make(moduleNames[0]) }, null);
        ModuleSourceDefinition moduleSourceDefn2 = new SourceModelModuleSource(moduleDefn2);
       
        ModuleSourceDefinition[] moduleSourceDefns = { moduleSourceDefn1, moduleSourceDefn2 };
       
        ModuleSourceDefinitionGroup mdg = new ModuleSourceDefinitionGroup(moduleSourceDefns);

        CompilerMessageLogger logger = new MessageLogger();
        Severity severity = workspaceManager.makeModules(moduleNames, mdg, logger);
       
        assertTrue(severity.compareTo(Severity.ERROR) < 0);
View Full Code Here

        workspaceManager.addStatusListener(recompileStatusListener);       
       
        Set<ModuleSourceDefinition> dependentSources = calculateDependentSources();
        ModuleName[] moduleNames = affectedModuleNames.toArray(new ModuleName[0]);
        ModuleSourceDefinition[] moduleSourceDefintionArray = dependentSources.toArray(new ModuleSourceDefinition[0]);
        ModuleSourceDefinitionGroup sourceDefinitionGroup = new ModuleSourceDefinitionGroup(moduleSourceDefintionArray);
        workspaceManager.makeModules(moduleNames, sourceDefinitionGroup, logger);
        workspaceManager.removeStatusListener(recompileStatusListener);
       
        return !setErrorStatus(logger);
    }
View Full Code Here

            // Now remove the reference to the old module from the source definition group and add the new module
            List<ModuleSourceDefinition> newModuleSources = new ArrayList<ModuleSourceDefinition>(Arrays.asList(sourceDefinitionGroup.getModuleSources()));
            newModuleSources.remove(sourceToRename);
            newModuleSources.add(renamedSource);
            ModuleSourceDefinition[] newModuleSourceArray = newModuleSources.toArray(ModuleSourceDefinition.EMPTY_ARRAY);
            this.sourceDefinitionGroup = new ModuleSourceDefinitionGroup(newModuleSourceArray);
           
            // Update the vault info map..
            VaultElementInfo newVaultInfo = VaultElementInfo.makeBasic("NonExistent", newFeatureName.getName(), null, 0);
            updateVaultInfo(newFeatureName.toModuleName(), newVaultInfo);
           
View Full Code Here

            firstModule = ModuleName.make(storedModules[0].getName());
        } else {
            firstModule = null;
        }
        // Reset the source definition group.
        this.sourceDefinitionGroup = new ModuleSourceDefinitionGroup(ModuleSourceDefinition.EMPTY_ARRAY);


        // Add new modules..
       
        // Import the stored module resources.
        List<StoredVaultElement.Module> storedModulesList = new ArrayList<StoredVaultElement.Module>(Arrays.asList(storedModules));
       
        for (Iterator<StoredVaultElement.Module> it = storedModulesList.iterator(); it.hasNext(); ) {
           
            StoredVaultElement.Module storedModule = it.next();

            if (isNullary() && !isTopLevelStoredModuleElementInStandardVault(storedModule) && !isCarBasedStoredModuleElementInStandardVault(storedModule)) {
                String warningString = "Module " + storedModule.getName() +
                        " was not imported.  Only Modules from the StandardVault or from a Car file may be used to initialize a nullary workspace.";
                initStatus.add(new Status(Status.Severity.WARNING, warningString));
               
                it.remove();
                continue;
            }
           
            importStoredModule(storedModule, initStatus);
        }
       
        // Create the module sources, and the source provider.
        ModuleSourceDefinition[] sourceDefinitions = new ModuleSourceDefinition[storedModulesList.size()];
        int index = 0;
        for (final StoredVaultElement.Module storedModule : storedModulesList) {
            ModuleName moduleName = ModuleName.make(storedModule.getName());
           
            CALSourceManager sourceManager = virtualResourceManager.getSourceManager(moduleName);
            if (sourceManager == null) {
                initStatus.add(new Status(Status.Severity.WARNING, "No registered source manager."));
                return initStatus;
            }
           
            sourceDefinitions[index] = sourceManager.getSource(moduleName, initStatus);
            index++;
        }

        this.sourceDefinitionGroup = new ModuleSourceDefinitionGroup(sourceDefinitions);
       
        // Persist the workspace description.
        if (!isNullary() && sourceDefinitionGroup.getNModules() > 0) {
            saveWorkspaceDescription(initStatus);
        }
View Full Code Here

       
        // Convert the list of source definitions to an array.
        ModuleSourceDefinition[] sourceDefinitions = new ModuleSourceDefinition[sourceDefinitionList.size()];
        sourceDefinitionList.toArray(sourceDefinitions);

        this.sourceDefinitionGroup = new ModuleSourceDefinitionGroup(sourceDefinitions);
    }
View Full Code Here

            newModuleSources.remove(existingModuleSource);
        }
        newModuleSources.add(newModuleSourceDefinition);

        ModuleSourceDefinition[] newModuleSourceArray = newModuleSources.toArray(ModuleSourceDefinition.EMPTY_ARRAY);
        this.sourceDefinitionGroup = new ModuleSourceDefinitionGroup(newModuleSourceArray);

        // Persist the workspace description if not nullary.
        if (!isNullary()) {
            saveWorkspaceDescription(addStatus);
        }
View Full Code Here

            }
        }
       
        ModuleSourceDefinition[] newModuleSourceArray = newModuleSources.toArray(ModuleSourceDefinition.EMPTY_ARRAY);
           
        this.sourceDefinitionGroup = new ModuleSourceDefinitionGroup(newModuleSourceArray);

        // Persist the workspace description (if not nullary).
        if (!isNullary()) {
            boolean descriptionSaved = saveWorkspaceDescription(removeStatus);
            if (!descriptionSaved) {
View Full Code Here

            ModuleSourceDefinition newModuleSourceDefinition = sourceManager.getSource(moduleName, syncStatus);
            newModuleSources.add(newModuleSourceDefinition);

            // Create the new source provider.
            ModuleSourceDefinition[] newModuleSourceArray = newModuleSources.toArray(ModuleSourceDefinition.EMPTY_ARRAY);
            this.sourceDefinitionGroup = new ModuleSourceDefinitionGroup(newModuleSourceArray);
           
            // Persist the workspace description.
            if (!isNullary() && sourceDefinitionGroup.getNModules() > 0) {
                saveWorkspaceDescription(syncStatus);
            }
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.ModuleSourceDefinitionGroup

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.