Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleName


     * @param classInstance the class instance to link to.
     * @param relativePathToBaseDirectory the relative path to the base directory for documentation generation.
     * @return the href attribute.
     */
    private HTMLBuilder.AttributeList getHrefAttributeForNonLocalClassInstanceReference(ClassInstance classInstance, String relativePathToBaseDirectory) {
        ModuleName definingModuleName = classInstance.getModuleName();
        ClassInstanceIdentifier identifier = classInstance.getIdentifier();
        String classInstanceLabel = labelMaker.getClassInstanceLabel(identifier);
       
        HTMLBuilder.AttributeList hrefAttribute;
        if (config.shouldSeparateInstanceDoc) {
View Full Code Here


     * Generates a reference to an instance method, appropriately hyperlinked.
     * @param classInstance the class instance of the instance method.
     * @param methodName the name of the instance method.
     */
    private void generateInstanceMethodReference(ClassInstance classInstance, String methodName) {
        ModuleName definingModuleName = classInstance.getModuleName();
        ClassInstanceIdentifier identifier = classInstance.getIdentifier();
        String instanceMethodLabel = labelMaker.getInstanceMethodLabel(identifier, methodName);
       
        if (!isDocForClassInstanceGenerated(classInstance)) {
            // if the class instance is not documented, no hyperlink can be made.
            generateClassInstanceDeclarationName(classInstance, false);
            currentPage.addText(" ").addText(methodName);
           
        } else {
            // the instance is indeed documented, so create a hyperlinked reference to the instance method
           
            HTMLBuilder.AttributeList hrefAttribute;
           
            if (config.shouldSeparateInstanceDoc) {
                if (inSeparateInstanceDoc) {
                    if (definingModuleName == null || definingModuleName.equals(currentModuleName)) {
                        hrefAttribute = localHrefAttribute(instanceMethodLabel);
                    } else {
                        hrefAttribute = nonLocalHrefAttribute(getSeparateInstanceDocFileName(definingModuleName), instanceMethodLabel);
                    }
                } else {
                    hrefAttribute = nonLocalHrefAttribute("../" + SEPARATE_INSTANCE_DOC_SUBDIRECTORY + "/" + getSeparateInstanceDocFileName(definingModuleName), instanceMethodLabel);
                }
            } else {
                if (definingModuleName == null || definingModuleName.equals(currentModuleName)) {
                    hrefAttribute = localHrefAttribute(instanceMethodLabel);
                } else {
                    hrefAttribute = nonLocalHrefAttribute(getModuleFileName(definingModuleName), instanceMethodLabel);
                }
            }
View Full Code Here

        } else if (type == CALFeatureName.MODULE) {
            generateModuleReference(featureName.toModuleName());
       
        } else if (type == CALFeatureName.CLASS_INSTANCE) {
            ClassInstanceIdentifier identifier = featureName.toInstanceIdentifier();
            ModuleName definingModuleName = featureName.toModuleName();
            generateClassInstanceReference(identifier, definingModuleName);
           
        } else if (type == CALFeatureName.INSTANCE_METHOD) {
            ClassInstanceIdentifier identifier = featureName.toInstanceIdentifier();
            ModuleName definingModuleName = featureName.toModuleName();
            String methodName = featureName.toInstanceMethodName();
            generateInstanceMethodReference(identifier, definingModuleName, methodName);
           
        } else {
            throw new IllegalArgumentException("feature type not supported: " + type);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    void generateModuleDescription(ModuleTypeInfo moduleTypeInfo) {
        ModuleName moduleName = moduleTypeInfo.getModuleName();
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getModuleFeatureName(moduleName), getLocale());
        CALDocComment docComment = moduleTypeInfo.getCALDocComment();

        /// For a module, just generate its description and supplementary blocks
        //
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    void beginTypeConsUsageDoc(TypeConstructor typeConstructor) {
        ModuleName moduleName = typeConstructor.getName().getModuleName();
        String typeName = typeConstructor.getName().getUnqualifiedName();
       
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getTypeConstructorFeatureName(typeConstructor.getName()), getLocale());
        CALDocComment docComment = typeConstructor.getCALDocComment();
       
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    void beginTypeClassUsageDoc(TypeClass typeClass) {
        ModuleName moduleName = typeClass.getName().getModuleName();
       
        CALFeatureMetadata metadata = getMetadata(CALFeatureName.getTypeClassFeatureName(typeClass.getName()), getLocale());
        CALDocComment docComment = typeClass.getCALDocComment();

        String label = labelMaker.getLabel(typeClass);
View Full Code Here

   
    /**
     * {@inheritDoc}
     */
    void beginUsageDocGroupForDependentModule(ScopedEntity documentedEntity, ModuleName dependentModuleName) {
        ModuleName moduleName = documentedEntity.getName().getModuleName();
       
        ////
        /// Generate a major section heading for the dependent module
        //
        currentPage.openTag(HTML.Tag.H2, classAttribute(StyleClassConstants.MAJOR_SECTION));
       
        // We either display "Defining module:" or "Dependent module:" depending on whether the dependent module
        // is really the defining module of the entity being documented
        if (moduleName.equals(dependentModuleName)) {
            currentPage.addText(LocalizableUserVisibleString.DEFINING_MODULE_COLON.toResourceString()).addText(" ");
        } else {
            currentPage.addText(LocalizableUserVisibleString.DEPENDENT_MODULE_COLON.toResourceString()).addText(" ");
        }
       
View Full Code Here

                    // try to find a module containing the base CAL type.
                    String baseCALTypeName = javaTypes[i].getUnqualifiedJavaSourceName();
                    if (baseCALTypeName.endsWith("_")) {
                        baseCALTypeName = baseCALTypeName.substring(0, baseCALTypeName.length()-1);
                    }
                    ModuleName moduleName = findModuleContainingType(baseCALTypeName);
                    if (moduleName == null) {
                        typeConstructorNames[i] = Name.TypeCons.makeUnqualified("J" + javaTypes[i].getUnqualifiedJavaSourceName());
                    } else {
                        moduleName = ModuleName.make(moduleName.toString() + "_JavaIO");
                        typeConstructorNames[i] = Name.TypeCons.make(moduleName, "J" + javaTypes[i].getUnqualifiedJavaSourceName());
                    }
                }
            }
           
View Full Code Here

                    ModuleTypeInfo m = findModuleWithClassInstance(CAL_Prelude.TypeClasses.Inputable, tc.getName());
                    if (m != null) {
                        inputableImports.add(m.getModuleName());
                    } else if (!tc.getName().getModuleName().equals(module.getModuleName())){
                        // Create a module name based on our naming.
                        ModuleName mn =
                            ModuleName.make(
                                    tc.getName().getModuleName().toString() + "_JavaIO");
                        inputableImports.add(mn);
                    }
                }               
View Full Code Here

                }
            }
           
            for (int i = 0, n = module.getNImportedModules(); i < n; ++i) {
                ModuleTypeInfo importedModule = module.getNthImportedModule(i);
                ModuleName mn = findModuleContainingType(visitedModules, typeName, importedModule);
                if (mn != null) {
                    return mn;
                }
            }
           
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.