Package org.openquark.cal.machine

Examples of org.openquark.cal.machine.Module


     * @param currentModule - name of the current module
     * @param logger
     * @return a list of EntryPoint
     */
    private final List<EntryPoint> getEntryPointsFromEntryPointSpecs (List<EntryPointSpec> entryPointSpecs, ModuleName currentModule, CompilerMessageLogger logger) {
        Module cmod = program.getModule(currentModule);
        ArrayList<SourceModel.FunctionDefn.Algebraic> adjunctSource = new ArrayList<SourceModel.FunctionDefn.Algebraic>();
        int targetCount = 0;
        ArrayList<EntryPointSpec> adjuntEntryPointSpecs = new ArrayList<EntryPointSpec> (entryPointSpecs.size());
       
        for (final EntryPointSpec entryPointSpec : entryPointSpecs) {
           
            String adjunctName = "rt_" + entryPointSpec.getFunctionalAgentName().getUnqualifiedName() + "_" + (targetCount++) + "_";
            String baseAdjunctName = adjunctName;
            int i = 0;
            while (cmod.getFunction(adjunctName) != null) {
                adjunctName = baseAdjunctName  + (i++);
            }
                       
            adjunctSource.add(
                SourceModel.FunctionDefn.Algebraic.make(
View Full Code Here


         * @param targetModuleName
         * @return The new function name.
         */
        private QualifiedName generateIOPolicyAdjunctName (QualifiedName functionalAgentToRun, ModuleName targetModuleName) {
       
            Module targetModule = program.getModule(targetModuleName);   
            String baseName = "io_" + functionalAgentToRun.getUnqualifiedName() + "_";
            int z = 0;
            while (targetModule.getModuleTypeInfo().getFunctionalAgent(baseName + z) != null) {
                z++;
            }
            String targetName = baseName + z + "_" + adjunctCount++;
            return QualifiedName.make(targetModuleName, targetName);
        }
View Full Code Here

    synchronized private void resetCachedResults(ModuleName moduleName, ExecutionContext context, Set<ModuleName> resetModules) {
        if (resetModules.contains (moduleName)) {
            return;
        }

        Module m = getModule(moduleName);
        if (m == null) {
            return;
        }

        resetModules.add(moduleName);
               
        for (final MachineFunction machineFunction : m.getFunctions()) {
            GMachineFunction gmf = (GMachineFunction)machineFunction;
            gmf.resetNGlobal(context);
        }
             
        for (final Module m2 : getModules()) {           
View Full Code Here

    * @param foreignClassLoader the classloader to use to resolve foreign classes for the module.
    * @return the newly created Module
    */
    @Override
    synchronized public Module addModule(ModuleName moduleName, ClassLoader foreignClassLoader) {
        Module module = new GModule(moduleName, foreignClassLoader);
        addModule (module);
        return module;
    }
View Full Code Here

    * @param foreignClassLoader the classloader to use to resolve foreign classes for the module.
    * @return the newly created Module
    */
    @Override
    synchronized public Module addModule(ModuleName moduleName, ClassLoader foreignClassLoader) {
        Module module = new LECCModule(moduleName, foreignClassLoader, resourceRepository);
        addModule (module);
        return module;
    }
View Full Code Here

                    MachineFunction mf = module.getFunction(var.getName());
                    // Determine if the var is an alias for another function.
                    if (mf != null) {
                        if (mf.getAliasOf() != null) {
                            QualifiedName aliasOf = mf.getAliasOf();
                            Module aliasModule = module.findModule(aliasOf.getModuleName());
                           
                            if (aliasModule != null) {
                                ModuleTypeInfo aliasModuleTypeInfo = aliasModule.getModuleTypeInfo();
                               
                                // Need to create a new Expression.Var to substitute.
                                // NOTE: We have to handle Prelude.if as a special case because there is no entity for it
                                // in the type info.
                                if (aliasModuleTypeInfo != null) {
View Full Code Here

                    MachineFunction mf = module.getFunction(var.getName());
                    // Determine if the var is an alias for another function.
                    if (mf != null) {
                        if (mf.getAliasOf() != null) {
                            QualifiedName aliasOf = mf.getAliasOf();
                            Module aliasModule = module.findModule(aliasOf.getModuleName());
                           
                            if (aliasModule != null) {
                                ModuleTypeInfo aliasModuleTypeInfo = aliasModule.getModuleTypeInfo();
                               
                                // Need to create a new Expression.Var to substitute.
                                // NOTE: We have to handle Prelude.if as a special case because there is no entity for it
                                // in the type info.
                                if (aliasModuleTypeInfo != null) {
View Full Code Here

TOP

Related Classes of org.openquark.cal.machine.Module

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.