Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.MessageLogger


     */
    public BasicCALServices getCalServices () {
        if (calServices == null) {
            calServices = BasicCALServices.make (WORKSPACE_FILE_PROPERTY, DEFAULT_WORKSPACE_FILE, DEFAULT_WORKSPACE_CLIENT_ID);
           
            CompilerMessageLogger logger = new MessageLogger();
            calServices.compileWorkspace(null, logger);
           
            List<CompilerMessage> compilerMessages = logger.getCompilerMessages(CompilerMessage.Severity.WARNING);
            if (!compilerMessages.isEmpty()) {
                int size = compilerMessages.size();
                for (int i = 0; i < size; i++) {
                    CompilerMessage message = compilerMessages.get(i);
                    System.err.println(message.toString());
View Full Code Here


     * @return the result from running the function
     * @throws CALExecutorException
     */
    private Object runCAF(QualifiedName funcName, BasicCALServices calServices, ExecutionContext context)
        throws CALExecutorException {
        CompilerMessageLogger ml = new MessageLogger ();

        // Compile it, indicating that this is an adjunct
        EntryPoint targetEntryPoint =
            calServices.getWorkspaceManager().getCompiler().getEntryPoint(
                EntryPointSpec.make(funcName), funcName.getModuleName(), ml);
View Full Code Here

    public void testInvokingNonCAF_lecc () {
        if (test_lecc_machine) {
            WorkspaceManager workspaceManager = leccCALServices.getWorkspaceManager();
            Compiler compiler = leccCALServices.getCompiler();

            CompilerMessageLogger messageLogger = new MessageLogger();
            EntryPoint entryPoint = compiler.getEntryPoint(
                EntryPointSpec.make(QualifiedName.make(CALPlatformTestModuleNames.RuntimeRegression, "nonCAFEntryPoint")),
                CALPlatformTestModuleNames.RuntimeRegression, messageLogger);
            if (messageLogger.getNMessages() > 0) {
                System.err.println(messageLogger.toString());
            }

            final ExecutionContext executionContext = leccCALServices.getWorkspaceManager().makeExecutionContextWithDefaultProperties();

            CALExecutor executor = workspaceManager.makeExecutor(executionContext);
View Full Code Here

            public void run() {
                try {
                    showMonitor();
                    setStatus(GemCutterMessages.getString("ReapplyingModificationsStatus"));
                   
                    CompilerMessageLogger messageLogger = new MessageLogger();
                    refactorer.apply(messageLogger);
                   
                    if(messageLogger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) >= 0) {
                        closeMonitor();
                        gemcutter.showCompilationErrors(messageLogger, GemCutterMessages.getString("ErrorWhileApplyingModifications"));
                        return;
                    }

                    incrementProgress();
                    setStatus(GemCutterMessages.getString("RecompilingStatus"));
                   
                    gemcutter.recompileWorkspace(true);
                   
                    if(messageLogger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) >= 0) {
                        closeMonitor();
                        gemcutter.showCompilationErrors(messageLogger, GemCutterMessages.getString("ErrorWhileRecompiling"));
                        return;
                    }
View Full Code Here

    public void testInvokingNonCAF_g () {
        if (test_g_machine) {
            WorkspaceManager workspaceManager = gCALServices.getWorkspaceManager();
            Compiler compiler = gCALServices.getCompiler();

            CompilerMessageLogger messageLogger = new MessageLogger();
            EntryPoint entryPoint = compiler.getEntryPoint(
                EntryPointSpec.make(QualifiedName.make(CALPlatformTestModuleNames.RuntimeRegression, "nonCAFEntryPoint")),
                CALPlatformTestModuleNames.RuntimeRegression, messageLogger);
            if (messageLogger.getNMessages() > 0) {
                System.err.println(messageLogger.toString());
            }

            final ExecutionContext executionContext = gCALServices.getWorkspaceManager().makeExecutionContextWithDefaultProperties();

            CALExecutor executor = workspaceManager.makeExecutor(executionContext);
View Full Code Here

            public void run() {
                try {
                    showMonitor();
                    setStatus(GemCutterMessages.getString("UndoingModificationsStatus"));
                   
                    CompilerMessageLogger messageLogger = new MessageLogger();
                    refactorer.undo(messageLogger);

                    if(messageLogger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) >= 0) {
                        closeMonitor();
                        gemcutter.showCompilationErrors(messageLogger, GemCutterMessages.getString("ErrorWhileApplyingModifications"));
                        return;
                    }

                    incrementProgress();
                    setStatus(GemCutterMessages.getString("RecompilingStatus"));
                   
                    gemcutter.recompileWorkspace(true);
                   
                    if(messageLogger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) >= 0) {
                        closeMonitor();
                        gemcutter.showCompilationErrors(messageLogger, GemCutterMessages.getString("ErrorWhileRecompiling"));
                        return;
                    }
View Full Code Here

    }


    public void testInvalidCoercion_lecc ()  {
        if (leccCALServices != null) {
            CompilerMessageLogger logger = new MessageLogger();
            AdjunctSource as = new AdjunctSource.FromText("testRunTarget = jObjectToInteger (unsafeCoerce (1 :: Int));");
            EntryPoint entryPoint =
                leccCALServices.getCompiler().getEntryPoint(
                    as,
                    EntryPointSpec.make(QualifiedName.make(CALPlatformTestModuleNames.RuntimeRegression, "testRunTarget")),
View Full Code Here

            help_testCAF_Cacheing(gCALServices);
        }
    }

    private void help_testCAF_Cacheing (BasicCALServices calServices) throws CALExecutorException {
        CompilerMessageLogger ml = new MessageLogger ();

        // Compile it, indicating that this is an adjunct
        EntryPoint targetEntryPoint =
            calServices.getWorkspaceManager().getCompiler().getEntryPoint(
                EntryPointSpec.make(QualifiedName.make(CALPlatformTestModuleNames.RuntimeRegression, "getCallCountCAF")),
View Full Code Here

       
        EntryPoint entryPoint = calServices.getCompiler().getEntryPoint(
            new AdjunctSource.FromText("private tempFunc = System.registerCleanable ((input (System.getProperty \"hook\")) :: Cleanable);"),
            EntryPointSpec.make(QualifiedName.make(CAL_System.MODULE_NAME, "tempFunc")),
            CAL_System.MODULE_NAME,
            new MessageLogger());
       
        CALExecutor executor = calServices.getWorkspaceManager().makeExecutor(executionContext);
       
        executor.exec(entryPoint, new Object[0]);
        calServices.getWorkspaceManager().resetCachedResults(executor.getContext());
View Full Code Here

    }
   
    private void help_testProgramEvaluatorEval_OutputPrimitiveArray(BasicCALServices calServices) throws CALExecutorException {
        String functionName = "tempFunc";
       
        CompilerMessageLogger logger = new MessageLogger();
       
        EntryPoint entryPoint = calServices.getCompiler().getEntryPoint(
            new AdjunctSource.FromSourceModel(SourceModel.FunctionDefn.Algebraic.make(
            functionName, Scope.PRIVATE, null,
            SourceModel.Expr.makeGemCall(CAL_Array.Functions.outputPrimitive,
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.MessageLogger

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.