Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleTypeInfo


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


        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedFunctionName = resolveFunctionOrClassMethodName(functionOrClassMethodName);
                if (qualifiedFunctionName != null) {
                    ModuleName moduleName = qualifiedFunctionName.getModuleName();
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String functionName = qualifiedFunctionName.getUnqualifiedName();
                        FunctionalAgent function = typeInfo.getFunctionOrClassMethod(functionName);
                        if (function == null) {
                            iceLogger.log(Level.INFO, "The function " + qualifiedFunctionName + " does not exist.");
                        } else {                           
                            ScopedEntityNamingPolicy scopedEntityNamingPolicy = new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(typeInfo);
                           
View Full Code Here

        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedTypeName = resolveTypeConsName(typeConsName);
                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();
                        TypeConstructor typeCons = typeInfo.getTypeConstructor(typeName);
                        if (typeCons == null) {
                            iceLogger.log(Level.INFO, "The type constructor " + qualifiedTypeName + " does not exist.");
                        } else {
                            CALDocComment comment = typeCons.getCALDocComment();
                            if (comment != null) {
View Full Code Here

        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedDataConsName = resolveDataConsName(expression);
                if (qualifiedDataConsName != null) {
                    ModuleName moduleName = qualifiedDataConsName.getModuleName();
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String dataConsName = qualifiedDataConsName.getUnqualifiedName();
                        DataConstructor dataCons = typeInfo.getDataConstructor(dataConsName);
                        if (dataCons == null) {
                            iceLogger.log(Level.INFO, "The data constructor " + qualifiedDataConsName + " does not exist.");
                        } else {
                            ScopedEntityNamingPolicy scopedEntityNamingPolicy = new ScopedEntityNamingPolicy.UnqualifiedUnlessAmbiguous(typeInfo);
                           
View Full Code Here

        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();
                        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) {
View Full Code Here

                        id = new TypeConstructorInstance(qualifiedTypeClassName, ((TypeConsApp)instanceTypeExpr).getName());
                    } else {
                        throw new IllegalArgumentException();       
                    }
                   
                    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();
View Full Code Here

                        id = new TypeConstructorInstance(qualifiedTypeClassName, ((TypeConsApp)instanceTypeExpr).getName());
                    } else {
                        throw new IllegalArgumentException();       
                    }
                   
                    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);
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();
                        TypeConstructor typeCons = typeInfo.getTypeConstructor(typeName);
                        if (typeCons == null) {
                            iceLogger.log(Level.INFO, "The type constructor " + qualifiedTypeName + " does not exist.");
                        } else if (typeCons.getNDataConstructors() == 0) {
                            iceLogger.log(Level.INFO, "The type " + typeCons.getName() + " is not an algebraic type.");
                        } else {
View Full Code Here

            if (module == null) {
                iceLogger.log(Level.WARNING, "Module not in program: " + moduleName);
                continue;
            }
           
            ModuleTypeInfo moduleTypeInfo = module.getModuleTypeInfo();
            typeInfoStats.collectTypeInfoStats(moduleTypeInfo);
        }
       
        if (typeInfoStats.totalModules == 0) {
            // nothing to do.
View Full Code Here

     * Resolves the given name as a function or class method given the current target module.
     * @param name the name to be resolved.
     * @return a QualifiedName for the resolved function, or null if the name cannot be resolved.
     */
    private QualifiedName resolveFunctionOrClassMethodName(String name) {
        ModuleTypeInfo moduleTypeInfo = getWorkspaceManager().getModuleTypeInfo(targetModule);
       
        QualifiedName resolvedName = CodeAnalyser.resolveEntityNameAccordingToImportUsingClauses(name, Category.TOP_LEVEL_FUNCTION_OR_CLASS_METHOD, moduleTypeInfo);
       
        if (resolvedName != null) {
            return resolvedName;
View Full Code Here

TOP

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

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.