Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleName


    }
   
    Object runFunction(EntryPointSpec entryPointSpec, Object[] arguments, ExecutionContext executionContext) throws CALExecutorException, GemCompilationException {
        cacheLock.readLock().lock();
        try {
            ModuleName moduleName = entryPointSpec.getFunctionalAgentName().getModuleName();
            ModuleCache moduleCache = getModuleCache(moduleName);
           
            return moduleCache.runFunction(entryPointSpec, arguments, executionContext);
        } finally {
            cacheLock.readLock().unlock();
View Full Code Here


        //split the entry points into sets of each module 
        HashMap<ModuleName, HashSet<EntryPointSpec> > specs = new HashMap<ModuleName, HashSet<EntryPointSpec> >();
       
        for(EntryPointSpec spec : entryPointSpecs) {
            ModuleName module = spec.getFunctionalAgentName().getModuleName();
            Set<EntryPointSpec> moduleSet = specs.get(module);
           
            if (moduleSet == null) {
                HashSet<EntryPointSpec> set = new HashSet<EntryPointSpec>();
                set.add(spec);
View Full Code Here

     */
    public ModuleNameToResourceManagerMapping getModuleNameToResourceManagerMapping(final String resourceType) {
        final Map<ModuleName, ResourceManager> mapping = new HashMap<ModuleName, ResourceManager>();
       
        for (final Map.Entry<ModuleName, Car.Accessor> entry : carAccessors.entrySet()) {
            final ModuleName moduleName = entry.getKey();
            final Car.Accessor carAccessor = entry.getValue();
           
            mapping.put(moduleName, carAccessor.getResourceManager(resourceType));
        }
       
View Full Code Here

            if (Character.isLowerCase(entryPointString.charAt(0))) {
                //the module name was not supplied
                return QualifiedName.make(CAL_Prelude.MODULE_NAME, entryPointString);
            }
   
            final ModuleName maybeModuleName = ModuleName.maybeMake(entryPointString);
            //the function name was not supplied
            if (maybeModuleName != null) {
                return QualifiedName.make(maybeModuleName, "main");
            } else {
                return QualifiedName.make(CAL_Prelude.MODULE_NAME, "main");
            }
        }
   
        ModuleName maybeModuleName = ModuleName.maybeMake(entryPointString.substring(0, periodPos));
        String unqualifiedName = entryPointString.substring(periodPos + 1);
   
        if (maybeModuleName != null) {
            return QualifiedName.make(maybeModuleName, unqualifiedName);
        } else {
View Full Code Here

         */
        public String getLocationString() {
            final StringBuilder location = new StringBuilder(baseRepository.getLocationString());
           
            for (final Map.Entry<ModuleName, Car.Accessor> entry : carAccessors.entrySet()) {
                final ModuleName moduleName = entry.getKey();
                final Car.Accessor carAccessor = entry.getValue();
               
                location.append("\n[Car: ").append(carAccessor.getCarFileName()).append(", module: ").append(moduleName).append("]");
            }
           
View Full Code Here

     * Reads a module name from the stream.
     * @return the module name read from the stream as a ModuleName.
     */
    public final ModuleName readModuleName() throws IOException {
        final String moduleNameString = readUTF();
        final ModuleName cachedModuleName = moduleNameCache.get(moduleNameString);
       
        if (cachedModuleName != null) {
            return cachedModuleName;
           
        } else {
            final ModuleName moduleName = ModuleName.make(moduleNameString);
            moduleNameCache.put(moduleNameString, moduleName);
            return moduleName;
        }
    }
View Full Code Here

        }
        /* ModuleName moduleName = */ s.readModuleName();
        int nImports = s.readInt();
        Set<ModuleName> set = new HashSet<ModuleName>();
        for (int i = 0; i < nImports; ++i) {
            ModuleName imported = s.readModuleName();
            set.add(imported);
        }
       
        s.skipRestOfRecord();
       
View Full Code Here

    public JavaBindingClassTest(String name) {
        super(name);
    }   
   
    public void testJavaBindingClasses () throws UnableToResolveForeignEntityException {
        ModuleName moduleNames[] = leccCALServices.getWorkspaceManager().getModuleNamesInProgram();
        ModuleName baseModuleNames[] = new ModuleName[0];
       
        helpTestJavaBindingClasses(leccCALServices, moduleNames, baseModuleNames, true, "org.openquark.cal");
    }
View Full Code Here

                if (i > 0) {
                    errorMessage.append(", ");
                }
               
                String failedModuleTargetPackage = failedModulePackages.get(i);
                ModuleName failedModuleName = failedModules.get(i);
                boolean failedModuleIsInternal = failedModuleInternal.get(i).booleanValue();
               
                String fullyQualifiedClassName =
                    JavaBindingGenerator.getPackageName(failedModuleTargetPackage, failedModuleName) + "." +
                    JavaBindingGenerator.getClassName(failedModuleName, !failedModuleIsInternal);
View Full Code Here

         * @param usageIndices the usage indices map.
         * @param qualifiedName the name of the type constructor whose index is to be returned.
         * @return the requested index.
         */
        private TreeSet<FunctionalAgent> getAppropriateIndex(Map<QualifiedName, Map<ModuleName, Pair<TreeSet<FunctionalAgent>, TreeSet<FunctionalAgent>>>> usageIndices, QualifiedName qualifiedName) {
            ModuleName entityModuleName = entity.getName().getModuleName();
            if (inReturnType) {
                return getReturnTypeIndex(usageIndices, qualifiedName, entityModuleName);
            } else {
                return getArgTypeIndex(usageIndices, qualifiedName, entityModuleName);
            }
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.