Package org.openquark.cal.services

Examples of org.openquark.cal.services.WorkspaceManager


            "unqualifiedFooReference = foo;\n" +
            "boundBarReference bar =\n" +
            "   foo bar;\n" +
            "intToOrderingReference = intToOrdering;";
       
        WorkspaceManager workspaceManager = leccServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
       
        ModuleTypeInfo moduleTypeInfo = workspaceManager.getModuleTypeInfo(CALRenaming_Test_Support2);
       
        QualifiedName oldName = QualifiedName.make(CALRenaming_Test_Support1, "foo");
        QualifiedName newName = QualifiedName.make(CALRenaming_Test_Support1, "intToOrdering");
       
        SourceModifier renamer = IdentifierRenamer.getSourceModifier(moduleTypeInfo, sourceText, oldName, newName, Category.TOP_LEVEL_FUNCTION_OR_CLASS_METHOD, logger);
View Full Code Here


            "    ;\n" +
            "foo :: " + Prelude + ".Num a => a -> a -> a;\n" +
            "public foo x = " + Prelude + ".add x;\n" +
            "refIntToOrdering = intToOrdering;";

        WorkspaceManager workspaceManager = leccServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
       
        ModuleTypeInfo moduleTypeInfo = workspaceManager.getModuleTypeInfo(CALRenaming_Test_Support1);
       
        QualifiedName oldName = QualifiedName.make(CALRenaming_Test_Support1, "foo");
        QualifiedName newName = QualifiedName.make(CALRenaming_Test_Support1, "intToOrdering");
       
        SourceModifier renamer = IdentifierRenamer.getSourceModifier(moduleTypeInfo, sourceText, oldName, newName, Category.TOP_LEVEL_FUNCTION_OR_CLASS_METHOD, logger);
View Full Code Here

            "    ;\n" +
            "foo :: " + Prelude + ".Num a => a -> a -> a;\n" +
            "public foo x = " + Prelude + ".add x;\n" +
            "refIntToOrdering = intToOrdering;";

        WorkspaceManager workspaceManager = leccServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
       
        ModuleTypeInfo moduleTypeInfo = workspaceManager.getModuleTypeInfo(CALRenaming_Test_Support1);
       
        QualifiedName oldName = CAL_Prelude.Functions.intToOrdering;
        QualifiedName newName = QualifiedName.make(Prelude, "foo");
       
        SourceModifier renamer = IdentifierRenamer.getSourceModifier(moduleTypeInfo, sourceText, oldName, newName, Category.TOP_LEVEL_FUNCTION_OR_CLASS_METHOD, logger);
View Full Code Here

            " * @see Alpha, Beta, Gamma, Cons, foobar\n" +
            " */\n" +
            "data Beta =\n" +
            "    Gamma;\n";       

        WorkspaceManager workspaceManager = leccServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
       
        ModuleTypeInfo moduleTypeInfo = workspaceManager.getModuleTypeInfo(CALRenaming_Test_Support1);
       
        QualifiedName oldName = QualifiedName.make(CALRenaming_Test_Support1, "Gamma");
        QualifiedName newName = QualifiedName.make(CALRenaming_Test_Support1, "Alpha");
       
        SourceModifier renamer = IdentifierRenamer.getSourceModifier(moduleTypeInfo, sourceText, oldName, newName, Category.DATA_CONSTRUCTOR, logger);
View Full Code Here

            " * @see Alpha, Beta, Gamma, Cons, foobar\n" +
            " */\n" +
            "data Beta =\n" +
            "    Gamma;\n";       

        WorkspaceManager workspaceManager = leccServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
       
        ModuleTypeInfo moduleTypeInfo = workspaceManager.getModuleTypeInfo(CALRenaming_Test_Support1);
       
        QualifiedName oldName = QualifiedName.make(CALRenaming_Test_Support1, "Gamma");
        QualifiedName newName = QualifiedName.make(CALRenaming_Test_Support1, "Cons");
       
        SourceModifier renamer = IdentifierRenamer.getSourceModifier(moduleTypeInfo, sourceText, oldName, newName, Category.DATA_CONSTRUCTOR, logger);
View Full Code Here

            " * @see Alpha, Beta, Gamma, Cons, foobar\n" +
            " */\n" +
            "data Beta =\n" +
            "    Gamma;\n";       

        WorkspaceManager workspaceManager = leccServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();
       
        ModuleTypeInfo moduleTypeInfo = workspaceManager.getModuleTypeInfo(CALRenaming_Test_Support1);
       
        QualifiedName oldName = QualifiedName.make(CALRenaming_Test_Support1, "Alpha");
        QualifiedName newName = QualifiedName.make(CALRenaming_Test_Support1, "Cons");
       
        SourceModifier renamer = IdentifierRenamer.getSourceModifier(moduleTypeInfo, sourceText, oldName, newName, Category.TYPE_CONSTRUCTOR, logger);
View Full Code Here

     * Get the name of a new module which doesn't exist in the program
     * @param calServices the cal services object on which to generate the module name.
     * @return the name of a module which doesn't exist in the program.
     */
    public static ModuleName getNewModuleName(BasicCALServices calServices) {
        WorkspaceManager workspaceManager = calServices.getWorkspaceManager();
        Set<ModuleName> moduleNames = new HashSet<ModuleName>(Arrays.asList(workspaceManager.getModuleNamesInProgram()));
       
        String baseName = "CompilerTestModule";
        ModuleName moduleName = ModuleName.make(baseName);
        int index = 1;
        while (moduleNames.contains(moduleName)){
View Full Code Here

        sourceDefString += outerDefnText;
       
        ModuleSourceDefinition sourceDef = new StringModuleSourceDefinition(moduleName, sourceDefString);
       
        // Get the workspace manager and the logger.
        WorkspaceManager workspaceManager = calServices.getWorkspaceManager();
        CompilerMessageLogger logger = new MessageLogger();

        // Compile the module.
        workspaceManager.makeModule(sourceDef, logger);

        // Remove the module.
        calServices.getWorkspaceManager().removeModule(moduleName, new Status("Remove module status."));

        return logger;
View Full Code Here

            ////
            /// Create and compile a workspace through a BasicCALServices
            //
           
            BasicCALServices calServices = BasicCALServices.make(workspaceName);
            WorkspaceManager workspaceManager = calServices.getWorkspaceManager();
           
            try {
                HTMLDocumentationGeneratorConfiguration config = CALDocTool.makeConfiguration(workspaceManager, args, logger);
               
                MessageLogger msgLogger = new MessageLogger();
View Full Code Here

        //the result of getNthPrime 5002 is 48647
        //the result of getNthPrime 5003 is 48649
        //the result of getNthPrime 5004 is 48661
              
        CompilerMessageLogger messageLogger = new MessageLogger();       
        WorkspaceManager workspaceManager = calServices.getWorkspaceManager();
        Compiler compiler = calServices.getCompiler();  
       
        EntryPoint entryPoint = compiler.getEntryPoint(
            EntryPointSpec.make(QualifiedName.make(CALPlatformTestModuleNames.M2, "getNthPrime")),
            CALPlatformTestModuleNames.M2, messageLogger);
        if (messageLogger.getNMessages() > 0) {
            System.err.println(messageLogger.toString());
        }
        CALExecutor executor = workspaceManager.makeExecutor(executionContext);
       
        try {
            for (int i = 0; i < nTimes; ++i) {
                Object result = executor.exec(entryPoint, new Object[] {new Integer(5000 + i)});
                System.out.println("the result of getNthPrime " + (5000 + i) + " is " + result);
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.WorkspaceManager

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.