Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.TypeClass


     * Generates the declaration name for a class instance, appropriately hyperlinked if requested.
     * @param classInstance the class instance whose name is to be generated.
     * @param shouldGenerateHyperlinks whether hyperlinks should be generated.
     */
    private void generateClassInstanceDeclarationName(ClassInstance classInstance, boolean shouldGenerateHyperlinks) {
        TypeClass typeClass = classInstance.getTypeClass();
        TypeExpr instanceType = classInstance.getType();
       
        QualifiedName typeClassName = typeClass.getName();      
       
        SourceModel.TypeSignature typeSig = instanceType.toSourceModel(true, ScopedEntityNamingPolicy.FULLY_QUALIFIED);
        SourceModel.TypeExprDefn typeExprDefn = typeSig.getTypeExprDefn();
       
        TypeSignatureHTMLGenerator visitor = new TypeSignatureHTMLGenerator(shouldGenerateHyperlinks);
View Full Code Here


             * Type classes and class methods
             */
            int nModuleTypeClasses = moduleTypeInfo.getNTypeClasses();
            totalTypeClasses += nModuleTypeClasses;
            for (int i = 0; i < nModuleTypeClasses; i++) {
                TypeClass nthTypeClass = moduleTypeInfo.getNthTypeClass(i);
                int nClassMethods = nthTypeClass.getNClassMethods();
                totalClassMethods += nClassMethods;
               
                for (int j = 0; j < nClassMethods; j++) {
                    ClassMethod nthClassMethod = nthTypeClass.getNthClassMethod(j);
                    if (nthClassMethod.hasDefaultClassMethod()) {
                        totalDefaultClassMethods++;
                    }
                }
            }
View Full Code Here

                }
            }
        }
       
        for (int i = 0, n = moduleInfo.getNTypeClasses(); i < n; i++) {
            TypeClass typeClass = moduleInfo.getNthTypeClass(i);
           
            if (parent.isDocForTypeClassGenerated(typeClass.getName().getModuleName(), typeClass.getName().getUnqualifiedName())) {
                labels.add(labelMaker.getLabel(typeClass));
               
                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    ClassMethod method = typeClass.getNthClassMethod(j);
                    if (parent.isDocForFunctionOrClassMethodGenerated(method.getName().getModuleName(), method.getName().getUnqualifiedName())) {
                        labels.add(labelMaker.getLabel(method));
                    }
                }
            }
        }
       
        for (int i = 0, n = moduleInfo.getNClassInstances(); i < n; i++) {
            ClassInstance instance = moduleInfo.getNthClassInstance(i);
            TypeClass typeClass = instance.getTypeClass();
           
            if (parent.isDocForClassInstanceGenerated(instance)) {
                labels.add(labelMaker.getLabel(instance));
               
                for (int j = 0, m = typeClass.getNClassMethods(); j < m; j++) {
                    ClassMethod method = typeClass.getNthClassMethod(j);
                    labels.add(labelMaker.getLabel(instance, method.getName().getUnqualifiedName()));
                }
            }
        }
       
View Full Code Here

                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String typeClassName = qualifiedTypeClassName.getUnqualifiedName();
                        TypeClass typeClass = typeInfo.getTypeClass(typeClassName);
                        if (typeClass == null) {
                            iceLogger.log(Level.INFO, "The type class " + qualifiedTypeClassName + " does not exist.");
                        } else {
                            CALDocComment comment = typeClass.getCALDocComment();
                            if (comment != null) {
                                iceLogger.log(Level.INFO, "CALDoc for the " + qualifiedTypeClassName + " type class:\n" + CALDocToTextUtilities.getTextFromCALDocComment(comment));
                            } else {
                                iceLogger.log(Level.INFO, "There is no CALDoc for the " + qualifiedTypeClassName + " type class.");
                            }
View Full Code Here

       
        // Type classes.
        int classCount = moduleInfo.getNTypeClasses();
        for (int i = 0; i < classCount; i++) {
           
            TypeClass typeClass = moduleInfo.getNthTypeClass(i);
            programFeatureNameSet.add(CALFeatureName.getScopedEntityFeatureName(typeClass));
           
            // Class methods.
            int methodCount = typeClass.getNClassMethods();
            for (int n = 0; n < methodCount; n++) {
                programFeatureNameSet.add(CALFeatureName.getScopedEntityFeatureName(typeClass.getNthClassMethod(n)));
            }
        }
       
        // Class instances.
        int instanceCount = moduleInfo.getNClassInstances();
        for (int n = 0; n < instanceCount; n++) {
           
            ClassInstance instance = moduleInfo.getNthClassInstance(n);
            programFeatureNameSet.add(CALFeatureName.getClassInstanceFeatureName(instance));
           
            // Instance methods.
            TypeClass typeClass = instance.getTypeClass();
            int methodCount = typeClass.getNClassMethods();
            for (int k = 0; k < methodCount; k++) {
                String methodName = typeClass.getNthClassMethod(k).getName().getUnqualifiedName();
                programFeatureNameSet.add(CALFeatureName.getInstanceMethodFeatureName(instance, methodName));
            }
        }
       
        return programFeatureNameSet;
View Full Code Here

            }
        }
       
        int nTypeClasses = moduleTypeInfo.getNTypeClasses();
        for (int i = 0; i < nTypeClasses; i++) {
            TypeClass typeClass = moduleTypeInfo.getNthTypeClass(i);
           
            // only generate the usage indices if the type constructor is actually to be documented
            if (filter.shouldGenerateScopedEntity(typeClass)) {
                beginTypeClassUsageDoc(typeClass);
                generateUsageIndicesForTypeConsOrTypeClass(typeClass, classUsageIndices);
View Full Code Here

        }
       
        int nTypeClasses = moduleTypeInfo.getNTypeClasses();
        List<TypeClass> typeClassesList = new ArrayList<TypeClass>(nTypeClasses);
        for (int i = 0; i < nTypeClasses; i++) {
            TypeClass entity = moduleTypeInfo.getNthTypeClass(i);
            if (filter.shouldGenerateScopedEntity(entity)) {
                typeClassesList.add(entity);
            }
        }
       
View Full Code Here

        /// Generate the list of instance methods
        /// (no filtering necessary: if the class instance is to be generated, then so should all its methods)
        //
        int nInstanceMethods = classInstance.getNInstanceMethods();
        beginInstanceMethodOverviewList(nInstanceMethods);
        TypeClass typeClass = classInstance.getTypeClass();
        for (int i = 0; i < nInstanceMethods; i++) {
            generateInstanceMethodOverview(classInstance, typeClass.getNthClassMethod(i).getName().getUnqualifiedName());
        }
        endInstanceMethodOverviewList(nInstanceMethods);
       
        generateClassInstanceOverviewFooter();
    }
View Full Code Here

        //
        int nTypeClasses = typeClasses.length;
        beginTypeClassesDocSection(nTypeClasses, calcMaxScopeOfScopedEntities(typeClasses));
        for (int i = 0; i < nTypeClasses; i++) {
           
            TypeClass typeClass = typeClasses[i];
            QualifiedName name = typeClass.getName();
            perModuleClassIndex.add(new IndexEntry(name.getUnqualifiedName(), labelMaker.getLabel(typeClass), typeClass.getScope(), IndexEntry.Kind.TYPE_CLASS));
           
            generateTypeClassDoc(typeClass, i);
        }
        endTypeClassesDocSection(nTypeClasses);
    }
View Full Code Here

        ////
        /// Generate documentation for each method of this class instance.
        //
        int nInstanceMethods = classInstance.getNInstanceMethods();
        beginInstanceMethodDocList(nInstanceMethods);
        TypeClass typeClass = classInstance.getTypeClass();
        for (int i = 0; i < nInstanceMethods; i++) {
            // no index entries for instance method definitions
            ClassMethod classMethod = typeClass.getNthClassMethod(i);
            generateInstanceMethodDoc(classInstance, classMethod.getName().getUnqualifiedName(), classMethod, i);
        }
        endInstanceMethodDocList(nInstanceMethods);
       
        generateClassInstanceDocFooter(classInstance, index);
View Full Code Here

TOP

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

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.