Package org.openquark.cal.compiler.io

Examples of org.openquark.cal.compiler.io.EntryPoint


     * @param code String The code to be run.
     * @return true if execution was successful, false otherwise.
     */
    protected boolean command_runCode(String code) {
        executionTimeGenerator.reset();
        EntryPoint entryPoint = makeRunTarget(code, true);
        boolean runResult = runFunction(entryPoint, !suppressOutput, true, !suppressIncrementalMachineStats);

        return runResult;
    }
View Full Code Here


            if (scDef == null) {
                return null;
            }
           
            statusListener.setSilent(true);
            EntryPoint entryPoint = compileAdjunct(scDef);
            statusListener.setSilent(false);
            return entryPoint;
        }
    }
View Full Code Here

       
        synchronized (this.workspaceManager) {
            CompilerMessageLogger ml = new MessageLogger ();
           
            // Compile it, indicating that this is an adjunct
            EntryPoint targetEntryPoint =
                getCompiler().getEntryPoint(
                    new AdjunctSource.FromText(scDef),
                    EntryPointSpec.make(QualifiedName.make(targetModule, targetName), new InputPolicy[]{}, OutputPolicy.DEFAULT_OUTPUT_POLICY),
                        targetModule,
                        ml);
View Full Code Here

        if (runTargetDef == null) {
            return new PerformanceTestResults(Collections.<StatsGenerator.StatsObject>emptyList(), Collections.<MachineStatistics>emptyList());
        }
       
        statusListener.setSilent(true);
        EntryPoint entryPoint = compileAdjunct(runTargetDef);
        statusListener.setSilent(false);
        if (entryPoint == null) {
            return new PerformanceTestResults(Collections.<StatsGenerator.StatsObject>emptyList(), Collections.<MachineStatistics>emptyList());
        }
View Full Code Here

        try {
            String functionName = "tempFunc" + threadID + "_" + iterID;
            CompilerMessageLogger logger = new MessageLogger();
           
            EntryPoint entryPoint = workspaceManager.getCompiler().getEntryPoint(
                new AdjunctSource.FromSourceModel(
                    SourceModel.FunctionDefn.Algebraic.make(
                        functionName, Scope.PRIVATE, null,
                        SourceModel.Expr.makeStringValue(expectedValue))),
                EntryPointSpec.make(QualifiedName.make(targetModule, functionName))
View Full Code Here

        try {
            String functionName = "tempFunc" + threadID + "_" + iterID;
           
            CompilerMessageLogger logger = new MessageLogger();
           
            EntryPoint entryPoint = workspaceManager.getCompiler().getEntryPoint(
                new AdjunctSource.FromSourceModel(
                    SourceModel.FunctionDefn.Algebraic.make(
                        functionName, Scope.PRIVATE, null,
                        SourceModelUtilities.TextParsing.parseExprIntoSourceModel(definingExpr))),
                EntryPointSpec.make(QualifiedName.make(targetModule, functionName)),
View Full Code Here

     * @throws CALExecutorException
     */
    static void help_testWithFunction(WorkspaceManager workspaceManager, ModuleName moduleName, String functionName) throws CALExecutorException {

        CompilerMessageLogger logger = new MessageLogger();
        EntryPoint entryPoint = workspaceManager.getCompiler().getEntryPoint(
            EntryPointSpec.make(QualifiedName.make(moduleName, functionName)),
            moduleName,
            logger);
       
        CALExecutor executor = workspaceManager.makeExecutor(workspaceManager.makeExecutionContextWithDefaultProperties());
View Full Code Here

         * @throws GemCompilationException
         */
        Object runFunction(EntryPointSpec entryPointSpec, Object[] arguments, ExecutionContext executionContext) throws CALExecutorException, GemCompilationException {           
            cacheLock.readLock().lock();
            try {
                EntryPoint ep = cache.get(entryPointSpec);
                if (ep == null) {
                    addEntryPoints(Collections.singletonList(entryPointSpec), true);
                    ep = cache.get(entryPointSpec);
                }      
                CALExecutor executor = programModelManager.makeExecutor(executionContext);
View Full Code Here

                //update the cache with the new entry points
                // entry point spec
                for (int i = 0, n = entryPoints.size(); i < n; i++) {
                    EntryPointSpec entryPointSpec = requiredList.get(i);
                    EntryPoint entryPoint = entryPoints.get(i);
                    if (entryPoint != null) {
                        cache.put(entryPointSpec, entryPoint);
                    } else {
                        cache.remove(entryPointSpec);
                    }
View Full Code Here

        EntryPointSpec addSpec = EntryPointSpec.make(QualifiedName.make(CAL_Prelude.MODULE_NAME, "add"), new InputPolicy[] {
            InputPolicy.INT_INPUT_POLICY,
            InputPolicy.DEFAULT_INPUT_POLICY
        }, OutputPolicy.DEFAULT_OUTPUT_POLICY);
       
        EntryPoint add = compiler.getEntryPoint(addSpec, CAL_Prelude.MODULE_NAME, messageLogger);
        assertNotNull(add);
        Object addResult = executor.exec(add, new Object[] { new Integer(1), new Integer(2) });
        assertTrue(addResult instanceof Integer);
        assertEquals(new Integer(1 + 2), addResult);
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.io.EntryPoint

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.