Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.ModuleName


     */
    private void command_docModule (String moduleNameString) {
        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
               
                ModuleName moduleName = resolveModuleNameInProgram(moduleNameString, true);
                if (moduleName == null) {
                    return;
                }
               
                ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
View Full Code Here


    private void command_docFunctionOrClassMethod(String functionOrClassMethodName) {
        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedFunctionName = resolveFunctionOrClassMethodName(functionOrClassMethodName);
                if (qualifiedFunctionName != null) {
                    ModuleName moduleName = qualifiedFunctionName.getModuleName();
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String functionName = qualifiedFunctionName.getUnqualifiedName();
View Full Code Here

    private void command_docType(String typeConsName) {
        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedTypeName = resolveTypeConsName(typeConsName);
                if (qualifiedTypeName != null) {
                    ModuleName moduleName = qualifiedTypeName.getModuleName();
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String typeName = qualifiedTypeName.getUnqualifiedName();
View Full Code Here

    private void command_docDataConstructor (String expression) {
        if (this.workspaceManager != null) {
            synchronized (this.workspaceManager) {
                QualifiedName qualifiedDataConsName = resolveDataConsName(expression);
                if (qualifiedDataConsName != null) {
                    ModuleName moduleName = qualifiedDataConsName.getModuleName();
                    ModuleTypeInfo typeInfo = workspaceManager.getModuleTypeInfo(moduleName);
                    if (typeInfo == null) {
                        iceLogger.log(Level.INFO, "The module " + moduleName + " does not exist.");
                    } else {
                        String dataConsName = qualifiedDataConsName.getUnqualifiedName();
View Full Code Here

            // Get the alternatives
            Expression.Switch.SwitchAlt[] alts = sw.getAlts();

            Map<Object, Code> altTagToCodeMap = new HashMap<Object, Code>();

            ModuleName moduleName = currentMachineFunction.getQualifiedName().getModuleName();
            // Build the code for each branch, save the variable requirement of each
            // branch as an alternative in gp, for later resolution
            for (final SwitchAlt alt : alts) {

                // For now, generate code for each tag.
View Full Code Here

            // Get the alternatives
            Expression.Switch.SwitchAlt[] alts = sw.getAlts();

            Map<Object, Code> altTagToCodeMap = new HashMap<Object, Code>();

            ModuleName moduleName = currentMachineFunction.getQualifiedName().getModuleName();
            // Build the code for each branch, save the variable requirement of each
            // branch as an alternative in gp, for later resolution
            for (final SwitchAlt alt : alts) {

                // For now, generate code for each tag.
View Full Code Here

                   
                    Set<ModuleName> moduleNames = new HashSet<ModuleName>();
                   
                    for (int i = 0, n = subDirectoryNames.size(); i < n; i++) {
                        String subDirectoryName = subDirectoryNames.get(i);
                        ModuleName moduleName = ProgramResourceLocator.createModuleNameFromPackageNameSegment(subDirectoryName);
                        if (moduleName != null) {
                            moduleNames.add(moduleName);
                        }
                    }
                    return moduleNames;
View Full Code Here

                   
                    File[] subDirectories = sourceGenerationRoot.listFiles();
                    if (subDirectories != null) {
                        for (final File subDirectory : subDirectories) {
                            String subDirectoryName = subDirectory.getName();
                            ModuleName moduleName = ProgramResourceLocator.createModuleNameFromPackageNameSegment(subDirectoryName);
                            if (subDirectory.isDirectory() && moduleName != null) {
                                moduleNames.add(moduleName);
                            }
                        }
                    }
View Full Code Here

                    } catch (final IllegalArgumentException e) {
                        logger.info(StandaloneJarToolMessages.getString("invalidScope", libClassScope));
                        return;
                    }
                   
                    final ModuleName moduleName = ModuleName.maybeMake(moduleNameString);
                    if (moduleName == null) {
                        logger.info(StandaloneJarToolMessages.getString("invalidModuleName", moduleNameString));
                        return;
                    }
                   
                    try {
                        libClassSpecs.add(LibraryClassSpec.make(scope, libClassName, moduleName));
                       
                    } catch (final StandaloneJarBuilder.InvalidConfigurationException e) {
                        logger.log(Level.INFO, StandaloneJarToolMessages.getString("errorPrefix", e.getMessage()));
                        return;
                    }
                   
                } else if (command.equals("-XX:all")) { // unsupported internal use argument - adds all modules in the program
                    arguments.consumeArgument();

                    addAllModulesAsLibraries = true;
                   
                } else {
                    // not a command... so break out of the loop to process the remainder
                    break;
                }
            }
           
            if (mainClassSpecs.isEmpty() && libClassSpecs.isEmpty() && !addAllModulesAsLibraries) {
                // there must be at least one -main or -lib command specified (or -XX:all)
                throw new ArgumentList.NotEnoughArgumentsException();
            }
           
            final File outputFile = new File(arguments.getAndConsumeArgument());
           
            final File outputSrcZipFile;
            if (arguments.hasMoreArguments()) {
               
                final String command = arguments.getAndConsumeArgument();
                if (command.equals("-src")) {
                    outputSrcZipFile = new File(arguments.getAndConsumeArgument());
                   
                } else {
                    showUsage(logger);
                    return;
                }
            } else {
                outputSrcZipFile = null;
            }
           
            arguments.noMoreArgumentsAllowed();

            if (!LECCMachineConfiguration.nonInterruptibleRuntime()) {
                logger.info(StandaloneJarToolMessages.getString("nonInterruptiblePropertyNotSet", NON_INTERRUPTIBLE_PROPERTY));
            }

            ////
            /// Compile the CAL workspace
            //

            logger.info(StandaloneJarToolMessages.getString("initializingCalWorkspace"));

            final MessageLogger msgLogger = new MessageLogger();

            final BasicCALServices calServices = BasicCALServices.makeCompiled(cwsName, msgLogger);

            if (calServices == null) {
                logger.info(msgLogger.toString());
                return;
            }

            logger.info(StandaloneJarToolMessages.getString("calWorkspaceInitialized"));

            final WorkspaceManager workspaceManager = calServices.getWorkspaceManager();
           
            // process the -XX:all argument
            if (addAllModulesAsLibraries) {
                for (final ModuleName moduleName : workspaceManager.getModuleNamesInProgram()) {
                    try {
                        libClassSpecs.add(LibraryClassSpec.make(JavaScope.PUBLIC, "cal.lib." + moduleName.toSourceText(), moduleName));

                    } catch (final StandaloneJarBuilder.InvalidConfigurationException e) {
                        logger.log(Level.INFO, StandaloneJarToolMessages.getString("errorPrefix", e.getMessage()));
                        return;
                    }
View Full Code Here

                    if (featureName instanceof CALFeatureName) {
                       
                        CALFeatureName calFeatureName = (CALFeatureName)featureName;

                        if (calFeatureName.hasModuleName()) {
                            ModuleName moduleName = calFeatureName.toModuleName();

                            // Get the base file path from the path mapper and use this to get the file with the right base folder.
                            ResourceName moduleResourceName = new ResourceName(CALFeatureName.getModuleFeatureName(moduleName));
                            FilePath baseFilePath = CALSourcePathMapper.INSTANCE.getResourcePath(moduleResourceName);
                            resourceFile = getNullaryEnvironment().getFile(baseFilePath, resourceFilePath, true);
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.