Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleName


         * @param moduleName the module name of the type constructor whose index is to be returned.
         * @param unqualifiedName the unqualified name of the type constructor whose index is to be returned.
         * @return the requested index.
         */
        private TreeSet<FunctionalAgent> getAppropriateIndex(Map<QualifiedName, Map<ModuleName, Pair<TreeSet<FunctionalAgent>, TreeSet<FunctionalAgent>>>> usageIndices, ModuleName moduleName, String unqualifiedName) {
            ModuleName entityModuleName = entity.getName().getModuleName();
            if (inReturnType) {
                return getReturnTypeIndex(usageIndices, moduleName, unqualifiedName, entityModuleName);
            } else {
                return getArgTypeIndex(usageIndices, moduleName, unqualifiedName, entityModuleName);
            }
View Full Code Here


       
        ////
        /// Run the preparation pass through all modules, and build up the direct dependency information
        //
        for (int i = 0, n = moduleNames.size(); i < n; i++) {
            ModuleName moduleName = moduleNames.get(i);
            ModuleTypeInfo moduleTypeInfo = programModelManager.getModuleTypeInfo(moduleName);
           
            for (int j = 0, nImportedModules = moduleTypeInfo.getNImportedModules(); j < nImportedModules; j++) {
                ModuleName importedModuleName = moduleTypeInfo.getNthImportedModule(j).getModuleName();
                addDirectModuleDependency(importedModuleName, moduleName);
            }
           
            prepareGenerationForModule(moduleTypeInfo);
        }
       
        ////
        /// Run the actual documentation generation pass
        //
        beginDoc();
       
        // first portion: main documentation
        for (int i = 0, n = moduleNames.size(); i < n; i++) {
            ModuleName moduleName = moduleNames.get(i);
            ModuleTypeInfo moduleTypeInfo = programModelManager.getModuleTypeInfo(moduleName);
            logger.fine(CALDocMessages.getString("STATUS.generatingDocumentationForModule", moduleName));
            generateModuleDoc(moduleTypeInfo);
        }
       
        // optional: usage documentation
        if (shouldGenerateUsageIndices) {
            for (int i = 0, n = moduleNames.size(); i < n; i++) {
                ModuleName moduleName = moduleNames.get(i);
                ModuleTypeInfo moduleTypeInfo = programModelManager.getModuleTypeInfo(moduleName);
                logger.fine(CALDocMessages.getString("STATUS.generatingUsageDocumentationForModule", moduleName));
                generateUsageIndices(moduleTypeInfo);
            }
        }
View Full Code Here

    void generateUsageIndicesForTypeConsOrTypeClass(ScopedEntity documentedEntity, Map<QualifiedName, Map<ModuleName, Pair<TreeSet<FunctionalAgent>, TreeSet<FunctionalAgent>>>> usageIndices) {
        if (!(documentedEntity instanceof TypeConstructor || documentedEntity instanceof TypeClass)) {
            throw new IllegalArgumentException();
        }
       
        ModuleName moduleName = documentedEntity.getName().getModuleName();
       
        // obtain the argument and return type indices from the usageIndices map
        Map<ModuleName, Pair<TreeSet<FunctionalAgent>, TreeSet<FunctionalAgent>>> theMap = usageIndices.get(documentedEntity.getName());
       
        ////
        /// generate for the defining module first
        //
        Pair<TreeSet<FunctionalAgent>, TreeSet<FunctionalAgent>> usageIndicesForTypeConsForDefiningModule = (theMap != null) ? theMap.get(moduleName) : null;
        generateUsageIndicesForDependentModule(documentedEntity, moduleName, usageIndicesForTypeConsForDefiningModule);
       
        ////
        /// then generate for the other dependent modules:
        //
       
        // get a new list for the names of the directly dependent modules, so that it can be filtered and sorted later
        Set<ModuleName> directlyDependentModuleNamesSet = getDirectlyDependentModuleNames(moduleName);
        List<ModuleName> directlyDependentModuleNames = new ArrayList<ModuleName>(directlyDependentModuleNamesSet);
       
        // filter the list of dependent modules
        directlyDependentModuleNames = filterModuleNames(directlyDependentModuleNames);
       
        // sort the list of dependent modules
        Collections.sort(directlyDependentModuleNames);
       
        // loop through each directly dependent module (excluding the defining module) and document the usages in each.
        int nDependentModules = directlyDependentModuleNames.size();
        for (int j = 0; j < nDependentModules; j++) {
           
            ModuleName dependentModuleName = directlyDependentModuleNames.get(j);
            Pair<TreeSet<FunctionalAgent>, TreeSet<FunctionalAgent>> usageIndicesForTypeCons = (theMap != null) ? theMap.get(dependentModuleName) : null;
           
            if (!dependentModuleName.equals(moduleName)) {
                generateUsageIndicesForDependentModule(documentedEntity, dependentModuleName, usageIndicesForTypeCons);
            }
        }
    }
View Full Code Here

     * @return the filtered list.
     */
    private List<ModuleName> filterModuleNames(List<ModuleName> moduleNames) {
        List<ModuleName> filteredModuleNames = new ArrayList<ModuleName>();
        for (int i = 0, n = moduleNames.size(); i < n; i++) {
            ModuleName moduleName = moduleNames.get(i);
           
            if (filter.shouldGenerateModule(moduleName)) {
                filteredModuleNames.add(moduleName);
            }
        }
View Full Code Here

    /**
     * Generates the documentation for a module.
     * @param moduleTypeInfo the ModuleTypeInfo of the module whose documentation is to be generated.
     */
    void generateModuleDoc(ModuleTypeInfo moduleTypeInfo) {
        ModuleName moduleName = moduleTypeInfo.getModuleName();
       
        ////
        /// First, collect the various entities that need to be documented, applying the user-specified filters along the way.
        //
        int nTypeConstructors = moduleTypeInfo.getNTypeConstructors();
View Full Code Here

     * Generates the header section of the documentation for a module.
     * @param moduleTypeInfo the ModuleTypeInfo of the module.
     */
    void generateModuleHeaderSection(ModuleTypeInfo moduleTypeInfo) {
       
        ModuleName moduleName = moduleTypeInfo.getModuleName();
       
        generateModuleDescription(moduleTypeInfo);
       
        ////
        /// Generate the list of imported modules
View Full Code Here

            if (filter.shouldGenerateScopedEntity(entity)) {
                dataConstructorsList.add(entity);
            }
        }

        ModuleName moduleName = typeConstructor.getName().getModuleName();

        ////
        /// Generate documentation for each data constructor of this type constructor, and add each to the main index
        /// and the argument type and return type indices.
        //
View Full Code Here

            if (filter.shouldGenerateScopedEntity(entity)) {
                classMethodsList.add(entity);
            }
        }
       
        ModuleName moduleName = typeClass.getName().getModuleName();
       
        ////
        /// Generate documentation for each method of this class, and add each to the main index
        /// and the argument type and return type indices.
        //
View Full Code Here

    private void command_docTypeClass (String typeClassString) {
        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedTypeClassName = resolveTypeClassName(typeClassString);
                if (qualifiedTypeClassName != null) {
                    ModuleName moduleName = qualifiedTypeClassName.getModuleName();
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String typeClassName = qualifiedTypeClassName.getUnqualifiedName();
View Full Code Here

       
        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedTypeName = resolveTypeConsName(type);
                if (qualifiedTypeName != null) {
                    ModuleName moduleName = qualifiedTypeName.getModuleName();
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String typeName = qualifiedTypeName.getUnqualifiedName();
View Full Code Here

TOP

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

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.