Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleName


                MonitorJobDescription jobDescription = document.getNthJobDescription (jobN);

                GemGraphGenerator generator = new GemGraphGenerator (calServices, jobDescription);

                //create each new job in separate modules.
                ModuleName jobModuleName = ModuleName.make(jobDescription.getJobId().toUpperCase());

                EntryPointSpec entry = calServices.addNewModuleWithFunction(jobModuleName, generator.getCalSource());

                MessageSource messageSource = MessageSourceFactory.createMessageSource (jobDescription);
                MonitorJob job = new MonitorJob (jobDescription, messageSource, entry);
View Full Code Here


         * Collect type info stats for the given module and add them to this stats collector.
         * @param moduleTypeInfo the type info for the module for which stats should be added to this stats collector.
         */
        public void collectTypeInfoStats(ModuleTypeInfo moduleTypeInfo) {
           
            ModuleName moduleName = moduleTypeInfo.getModuleName();
           
            /*
             * Module-level stats
             */
            totalModules++;
View Full Code Here

         * {@inheritDoc}
         */
        public void generateTextFile(String subdirectory, String fileName, String content, Charset charset) {
            if (subdirectory.endsWith("modules")) {
                // look for the last dot because the other dots are part of the hierarchical module name
                ModuleName moduleName = ModuleName.make(fileName.substring(0, fileName.lastIndexOf('.')));
                helpVerifyModuleDocPage(moduleName, content, parent);
                seenModules.add(moduleName);
            }
        }       
View Full Code Here

    /**
     * Tests the creation of a new module through the method WorkspaceManager.makeModule().
     */
    public void testMakeModule() {
        ModuleName moduleName = ModuleName.make("TEST_MakeModule");
       
        SourceModel.ModuleDefn moduleDefn = SourceModel.ModuleDefn.make(moduleName, new SourceModel.Import[] { SourceModel.Import.make(CAL_Prelude.MODULE_NAME) }, null);
        ModuleSourceDefinition moduleSourceDefn = new SourceModelModuleSource(moduleDefn);

        try {
View Full Code Here

       
        for (int i = 0; i < numThreads; i++) {
            final int threadID = i;
            threads[i] = new Thread() {
                public void run() {
                    ModuleName moduleName = ModuleName.make("TempModule" + threadID);
                    MessageLogger messageLogger = new MessageLogger();
                    workspaceManager.makeModule(new SourceModelModuleSource(SourceModelUtilities.TextParsing.parseModuleDefnIntoSourceModel("module " + moduleName + "; import " + CAL_Prelude.MODULE_NAME + "; public foo x = (\\y -> x + x + y) 3.0; public bar = foo;")), messageLogger);
                   
                    if (messageLogger.getNErrors() > 0) {
                        multithreadedAssertEquals("No compilation errors", messageLogger.toString(), assertList);
                    } else {
                        for (int k = 0; k < numDependentModules; k++) {
                            String moduleName2 = "TempModule" + threadID + "_" + k;
                            workspaceManager.makeModule(new SourceModelModuleSource(SourceModelUtilities.TextParsing.parseModuleDefnIntoSourceModel("module " + moduleName2 + "; import " + CAL_Prelude.MODULE_NAME + "; import " + moduleName + ";")), messageLogger);
                        }
                        if (messageLogger.getNErrors() > 0) {
                            multithreadedAssertEquals("No compilation errors", messageLogger.toString(), assertList);
                        } else {
                            for (int j = 0; j < numCompilationsPerThread; j++) {
                                help_compileEvalTestFunctionForThread(workspaceManager, moduleName, threadID, j, numEvalTries, assertList);
                               
                                for (int k = 0; k < numDependentModules; k++) {
                                    ModuleName moduleName2 = ModuleName.make("TempModule" + threadID + "_" + k);
                                    help_compileEvalDependentTestFunctionForThread(workspaceManager, moduleName2, moduleName + ".bar 5.0", new Double(13.0), threadID, j, numEvalTries, assertList);
                                }
                            }
                        }
                    }
View Full Code Here

        for (final ModuleName moduleName : moduleNames) {
            final int nModuleNameComponents = moduleName.getNComponents();
           
            ModuleHierarchyInfo parent = root;
            for (int i = 0; i < nModuleNameComponents; i++) {
                final ModuleName prefix = moduleName.getPrefix(i+1); // goes from 1 to nComponents
                final boolean isActualModule = (i == nModuleNameComponents - 1);
                final ModuleHierarchyInfo child = parent.makeChild(prefix, isActualModule);
               
                // for next iteration:
                parent = child;
View Full Code Here

     */
    private ModuleHierarchyInfo getFlatModuleGrouping(final Set<ModuleName> moduleNames) {
        final ModuleHierarchyInfo root = new ModuleHierarchyInfo();
       
        for (final ModuleName moduleName : moduleNames) {
            final ModuleName immediatePrefix = moduleName.getImmediatePrefix();
           
            if (immediatePrefix == null) {
                root.makeChild(moduleName, true);
            } else {
                final ModuleHierarchyInfo parent = root.makeChild(immediatePrefix, false);
View Full Code Here

       
        currentPage.openTag(HTML.Tag.DIV, idAndClassAttributes(moduleTreeNodeElementID, StyleClassConstants.TREE_DIV));
       
        for (final Map.Entry<Pair<ModuleName, Boolean>, ModuleHierarchyInfo> entry : node.getChildren().entrySet()) {
            final Pair<ModuleName, Boolean> key = entry.getKey();
            final ModuleName childName = key.fst();
            final boolean childIsActualModule = key.snd().booleanValue();
            final ModuleHierarchyInfo child = entry.getValue();
            final String childDisplayName = childName.getNthComponent(level);
            final String fullyQualifiedNameForChildModule = getFullyQualifiedNameForModule(childName);
           
            final String childDivElementID = getModuleTreeNodeElementID("mlH", childName);

            currentPage.openTag(HTML.Tag.DIV);
View Full Code Here

       
        currentPage.openTag(HTML.Tag.DIV, idAndClassAttributes(moduleTreeNodeElementID, StyleClassConstants.TREE_DIV));
       
        for (final Map.Entry<Pair<ModuleName, Boolean>, ModuleHierarchyInfo> entry : node.getChildren().entrySet()) {
            final Pair<ModuleName, Boolean> key = entry.getKey();
            final ModuleName childName = key.fst();
            final boolean childIsActualModule = key.snd().booleanValue();
            final ModuleHierarchyInfo child = entry.getValue();
            final String childDisplayName = isChildLevel ? childName.getLastComponent() : childName.toSourceText();
            final String fullyQualifiedNameForChildModule = getFullyQualifiedNameForModule(childName);
           
            final String childDivElementID = getModuleTreeNodeElementID("mlG", childName);

            currentPage.openTag(HTML.Tag.DIV);
View Full Code Here

       
        SortedSet<ModuleName> rootLevelModules = new TreeSet<ModuleName>();
       
        for (final Map.Entry<Pair<ModuleName, Boolean>, ModuleHierarchyInfo> entry : node.getChildren().entrySet()) {
            final Pair<ModuleName, Boolean> key = entry.getKey();
            final ModuleName childName = key.fst();
            final ModuleHierarchyInfo child = entry.getValue();
           
            if (child.getChildren().isEmpty()) {
                rootLevelModules.add(childName);
            }
        }
       
        // first list out the modules with "namespaces" (i.e. their names have >1 components)
        for (final Map.Entry<Pair<ModuleName, Boolean>, ModuleHierarchyInfo> entry : node.getChildren().entrySet()) {
            final Pair<ModuleName, Boolean> key = entry.getKey();
            final ModuleName childName = key.fst();
            final ModuleHierarchyInfo child = entry.getValue();
           
            if (rootLevelModules.contains(childName)) {
                continue;
            }
           
            currentPage
                .openTag(HTML.Tag.DIV, classAttribute(StyleClassConstants.RELATED_MODULES_LIST))
                .addText(childName.toSourceText())
                .addText(LocalizableUserVisibleString.COLON.toResourceString())
                .addText(" ");
           
            int counter2 = 0;
            for (final Pair<ModuleName, Boolean> key2 : child.getChildren().keySet()) {
                final ModuleName childName2 = key2.fst();
               
                if (counter2 > 0) {
                    currentPage.addText(LocalizableUserVisibleString.COMMA_AND_SPACE.toResourceString());
                }

                generateModuleReference(currentPage, null, childName2, childName2.getLastComponent());
               
                counter2++;
            }
           
            currentPage.closeTag(HTML.Tag.DIV);
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.