Examples of ModuleName


Examples of org.openquark.cal.compiler.ModuleName

                    // try to find a module containing the base CAL type.
                    String baseCALTypeName = javaTypes[i].getUnqualifiedJavaSourceName();
                    if (baseCALTypeName.endsWith("_")) {
                        baseCALTypeName = baseCALTypeName.substring(0, baseCALTypeName.length()-1);
                    }
                    ModuleName moduleName = findModuleContainingType(baseCALTypeName);
                    if (moduleName == null) {
                        typeConstructorNames[i] = Name.TypeCons.makeUnqualified("J" + javaTypes[i].getUnqualifiedJavaSourceName());
                    } else {
                        moduleName = ModuleName.make(moduleName.toString() + "_JavaIO");
                        typeConstructorNames[i] = Name.TypeCons.make(moduleName, "J" + javaTypes[i].getUnqualifiedJavaSourceName());
                    }
                }
            }
           
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

                    ModuleTypeInfo m = findModuleWithClassInstance(CAL_Prelude.TypeClasses.Inputable, tc.getName());
                    if (m != null) {
                        inputableImports.add(m.getModuleName());
                    } else if (!tc.getName().getModuleName().equals(module.getModuleName())){
                        // Create a module name based on our naming.
                        ModuleName mn =
                            ModuleName.make(
                                    tc.getName().getModuleName().toString() + "_JavaIO");
                        inputableImports.add(mn);
                    }
                }               
View Full Code Here

Examples of org.openquark.cal.compiler.ModuleName

                }
            }
           
            for (int i = 0, n = module.getNImportedModules(); i < n; ++i) {
                ModuleTypeInfo importedModule = module.getNthImportedModule(i);
                ModuleName mn = findModuleContainingType(visitedModules, typeName, importedModule);
                if (mn != null) {
                    return mn;
                }
            }
           
View Full Code Here

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

Examples of org.openquark.cal.compiler.ModuleName

         * 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

Examples of org.openquark.cal.compiler.ModuleName

         * {@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

Examples of org.openquark.cal.compiler.ModuleName

    /**
     * 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

Examples of org.openquark.cal.compiler.ModuleName

       
        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

Examples of org.openquark.cal.compiler.ModuleName

        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

Examples of org.openquark.cal.compiler.ModuleName

     */
    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
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.