Examples of ModuleName


Examples of org.openquark.cal.compiler.ModuleName

     * Constructs a file name for the type class usage indices page from a type class name, properly disambiguated.
     * @param qualifiedName the qualified name of the type class.
     * @return the corresponding file name.
     */
    private String getTypeClassUsageIndexFileName(QualifiedName qualifiedName) {
        ModuleName moduleName = qualifiedName.getModuleName();
        return getDisambiguatedNameForModule(moduleName) + DOT + getDisambiguatedNameForTypeClass(moduleName, qualifiedName.getUnqualifiedName()) + DOT + HTML_FILE_EXTENSION;
    }
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

     * @param builder the HTMLBuilder for generating the reference.
     * @param relativeDirectory the relative directory path to get to the modules subdirectory. Can be null if the current directory is the modules subdirectory.
     * @param reference the name of the module to link to.
     */
    private void generateModuleReference(HTMLBuilder builder, String relativeDirectory, CALDocComment.ModuleReference reference) {
        ModuleName moduleName = reference.getName();
        String displayName = reference.getModuleNameInSource();
        if (displayName.length() == 0) {
            displayName = getMinimallyQualifiedNameForModule(moduleName);
        }
        generateModuleReference(builder, relativeDirectory, moduleName, displayName);
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

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

Examples of org.openquark.cal.compiler.ModuleName

     */
    public static Object runExpr(String testName, SourceModel.Expr expr, BasicCALServices calServices)
        throws CALExecutorException, GemCompilationException {

        String functionName = "runCode_" + testName;
        ModuleName moduleName = ModuleName.make("TEST_" + functionName);

        SourceModel.FunctionDefn function = SourceModel.FunctionDefn.Algebraic.make(
            functionName, Scope.PRIVATE, null, expr);

        try {
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

     * Verifies that the prelude function is found by a module class loader.
     *
     */
    public void testCorrectLoaderChosen() {
       
        ModuleName adjunctModuleName = CALPlatformTestModuleNames.M1;
        String adjunctUnqualifiedName = "testAdjunct";
        QualifiedName qualifiedAdjunctName = QualifiedName.make(adjunctModuleName, adjunctUnqualifiedName);
        QualifiedName qualifiedDependeeFunctionName = QualifiedName.make(adjunctModuleName, "callNot");
        QualifiedName qualifiedPreludeDependeeName = CAL_Prelude.Functions.not;
       
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

    /**
     * {@inheritDoc}
     */
    public ResourceName getResourceNameFromFolderAndFileName(Folder folder, String fileName) {
       
        ModuleName moduleName = getModuleNameFromResourcePath(folder);
        if (moduleName == null) {
            return null;
        }
       
        int lastPeriodPos = fileName.lastIndexOf('.');
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

        //
        Map<String, Set<ModuleName>> workspaceDeclToModuleNamesMap = new HashMap<String, Set<ModuleName>>();
       
        for (final Map.Entry<ModuleName, LinkedHashSet<Pair<String, VaultElementInfo>>> entry : moduleNameToWorkspaceDeclInfoMap.entrySet()) {
           
            ModuleName moduleName = entry.getKey();
            LinkedHashSet<Pair<String, VaultElementInfo>> workspaceDeclInfo = entry.getValue();
           
            VaultElementInfo actualVaultInfo = null;
            for (final Pair<String, VaultElementInfo> workspaceDeclNameAndVaultElementInfoPair : workspaceDeclInfo) {
               
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

    private static void showMessagesAboutConflictingWorkspaceEntries(Monitor monitor, Map<ModuleName, LinkedHashSet<Pair<String, VaultElementInfo>>> moduleNameToConflictingWorkspaceEntriesMap) {
        List<String> messages = new ArrayList<String>();
       
        for (final Map.Entry<ModuleName, LinkedHashSet<Pair<String, VaultElementInfo>>> entry : moduleNameToConflictingWorkspaceEntriesMap.entrySet()) {
           
            ModuleName moduleName = entry.getKey();
            LinkedHashSet<Pair<String, VaultElementInfo>> conflictingWorkspaceEntries = entry.getValue();
           
            messages.add(MESSAGES.getString("moduleHasVaultInfoConflictsHeader", moduleName));
           
            for (final Pair<String, VaultElementInfo> workspaceDeclNameAndVaultElementPair : conflictingWorkspaceEntries) {
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

            // Add each module and all their resources to the Car
            monitor.carBuildingStarted(fileName, moduleNames.length);
           
            for (int i = 0; i < moduleNames.length && !monitor.isCanceled(); i++) {
                ModuleName moduleName = moduleNames[i];
                monitor.processingModule(fileName, moduleName);
               
                ModulePackager.writeModuleToJar(workspace, moduleName, jos, config.buildSourcelessModules);
                writeModuleProgramResourcesToCar(workspaceManager, moduleName, jos, programResourcePathMapper);
            }
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

        }
       
        // Just a regular type cons.
       
        // If in the current module, we can use in unqualified form.
        ModuleName typeConsModuleName = typeConsName.getModuleName();
        if (typeConsModuleName.equals(generationInfo.getCurrentModuleName())) {
            return TypeExprDefn.TypeCons.make(null, typeConsName.getUnqualifiedName());
       
       
        } else if (typeConsModuleName.equals(CAL_Prelude.MODULE_NAME)) {
            // If in the Prelude, may also be able to use the unqualified form, but this means we need to add to the using clause.
            // We cannot use in an unqualifed way if a type with the same unqualifed name exists in the current module.
            String unqualifiedTypeName = typeConsName.getUnqualifiedName();
           
            if (generationInfo.addTypeToPreludeUsingSet(unqualifiedTypeName)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.