Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ClassInstance


                return null;
            }
            visitedModules.add(module);
           
            for (int i = 0, n = module.getNClassInstances(); i < n; ++i) {
                ClassInstance ci = module.getNthClassInstance(i);
                if (ci.getTypeClass().getName().equals(className)) {
                    // Check the instance type
                    TypeExpr instanceTypeExpr = ci.getType();
                    TypeConsApp tca = instanceTypeExpr.rootTypeConsApp();
                    if (tca != null) {
                        if (tca.getRoot().getName().equals(typeConstructorName)) {
                            return module;
                        }
View Full Code Here


             */
            int nClassInstances = moduleTypeInfo.getNClassInstances();
            totalClassInstances += nClassInstances;
           
            for (int i = 0; i < nClassInstances; i++) {
                ClassInstance nthClassInstance = moduleTypeInfo.getNthClassInstance(i);
                int nInstanceMethods = nthClassInstance.getNInstanceMethods();
               
                boolean encounteredInternalNonTypeOfClassMethod = false;
                boolean encounteredTypeOfClassMethod = false;
                boolean nonInternalInstanceMethodEncountered = false;
                boolean defaultInstanceMethodEncountered = false;
               
                /*
                 * count the different styles of instances
                 */
                if (nthClassInstance.getInstanceStyle() == ClassInstance.InstanceStyle.DERIVING) {
                    totalDerivedClassInstances++;
                } else if (nthClassInstance.getInstanceStyle() == ClassInstance.InstanceStyle.INTERNAL) {
                    totalTypeableClassInstances++;
                } else if (nthClassInstance.getInstanceStyle() == ClassInstance.InstanceStyle.EXPLICIT) {
                    totalExplicitClassInstances++;
                }
               
                /*
                 * count the instance methods
                 */
                for (int j = 0; j < nInstanceMethods; j++) {
                    QualifiedName instanceMethod = nthClassInstance.getInstanceMethod(j);
                    if (instanceMethod == null) {
                        totalDefaultInstanceMethods++;
                        defaultInstanceMethodEncountered = true;
                   
                    } else {
View Full Code Here

                }
            }
        }
       
        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++) {
View Full Code Here

     * Generates a reference to a class instance, appropriately hyperlinked.
     * @param identifier the class instance identifier.
     * @param definingModuleName the name of the module in which the instance is defined.
     */
    private void generateClassInstanceReference(ClassInstanceIdentifier identifier, ModuleName definingModuleName) {
        ClassInstance classInstance = programModelManager.getModuleTypeInfo(definingModuleName).getClassInstance(identifier);
        generateClassInstanceReference(classInstance);
    }
View Full Code Here

     * @param identifier the class instance identifier.
     * @param definingModuleName the name of the module in which the instance is defined.
     * @param methodName the name of the instance method.
     */
    private void generateInstanceMethodReference(ClassInstanceIdentifier identifier, ModuleName definingModuleName, String methodName) {
        ClassInstance classInstance = programModelManager.getModuleTypeInfo(definingModuleName).getClassInstance(identifier);
        generateInstanceMethodReference(classInstance, methodName);
    }
View Full Code Here

       
        // 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));
            }
View Full Code Here

                   
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(targetModule);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + targetModule + " does not exist.");
                    } else {
                        ClassInstance instance = typeInfo.getVisibleClassInstance(id);
                       
                        if (instance == null) {
                            iceLogger.log(Level.INFO, "The instance " + id + " does not exist.");
                        } else {
                            CALDocComment comment = instance.getCALDocComment();
                            if (comment != null) {
                                iceLogger.log(Level.INFO, "CALDoc for the " + id + " instance:\n" + CALDocToTextUtilities.getTextFromCALDocComment(comment));
                            } else {
                                iceLogger.log(Level.INFO, "There is no CALDoc for the " + id + " instance.");
                            }
View Full Code Here

                   
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(targetModule);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + targetModule + " does not exist.");
                    } else {
                        ClassInstance instance = typeInfo.getVisibleClassInstance(id);
                       
                        if (instance == null) {
                            iceLogger.log(Level.INFO, "The instance " + id + " does not exist.");
                        } else {
                            ScopedEntityNamingPolicy scopedEntityNamingPolicy = new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(typeInfo);
                           
                            TypeExpr instanceMethodTypeExpr = instance.getInstanceMethodType(methodName);
                           
                            iceLogger.log(Level.INFO, methodName + " :: " + instanceMethodTypeExpr.toString(scopedEntityNamingPolicy) + "\n");
                           
                            ClassMethod classMethod = instance.getTypeClass().getClassMethod(methodName);
                           
                            try {
                                CALDocComment comment = instance.getMethodCALDocComment(methodName);
                                if (comment != null) {
                                    iceLogger.log(Level.INFO, "CALDoc for the " + methodName + " method in the " + id + " instance:\n" + CALDocToTextUtilities.getTextFromCALDocComment(comment, classMethod, instanceMethodTypeExpr, scopedEntityNamingPolicy));
                                } else {
                                    CALDocComment classMethodCALDoc = classMethod.getCALDocComment();
                                    String classMethodDoc;
View Full Code Here

            ////
            /// generate the instance index
            //
            beginUsageDocInstanceIndex(documentedEntity, nInstances, calcMaxScopeOfClassInstances(instances));
            for (int i = 0; i < nInstances; i++) {
                ClassInstance instance = instances.get(i);
                generateUsageDocInstanceIndexEntry(documentedEntity, instance);
            }
            endUsageDocInstanceIndex(documentedEntity, nInstances);
           
            endUsageDocGroupForDependentModule(documentedEntity, dependentModuleName);
View Full Code Here

        }
       
        int nClassInstances = moduleTypeInfo.getNClassInstances();
        List<ClassInstance> classInstancesList = new ArrayList<ClassInstance>(nClassInstances);
        for (int i = 0; i < nClassInstances; i++) {
            ClassInstance classInstance = moduleTypeInfo.getNthClassInstance(i);
            if (isDocForClassInstanceGenerated(classInstance)) {
                classInstancesList.add(classInstance);
            }
        }
       
View Full Code Here

TOP

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

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.