Package eu.admire.dispel.parser.types

Examples of eu.admire.dispel.parser.types.Function


        mRegistry.registerProcessingElement("uk.org.ogsadai.SQLQuery");
        mRegistry.registerProcessingElement("uk.org.ogsadai.ListConcatenate");
        mRegistry.registerProcessingElement("eu.admire.madeup.DuplicatePruner");
        DISPELGraphBuilder builder =
            runDISPEL(new FileReader("test/unit/eu/admire/dispel/parser/v4/converter/ltype_example2.dispel"));
        Function function = builder.getFunctions().get("eu.admire.makeCorroboratedSQLQuery");
        System.out.println(FunctionToDISPEL.convert(function));
    }
View Full Code Here


      if (LOG.isDebugEnabled())
      {
          LOG.debug("Resolved function name to : " + resolvedFunctionName);
      }
     
        Function function =
            executionState.getFunctions().get(resolvedFunctionName);
        if (function == null)
        {
            function = getFunctionFromRegistry(
                resolvedFunctionName,
                functionArguments,
                registry,
                optimiser,
                executionState);
           
            if (function == null)
            {
                throw new UndefinedFunctionException(
                    resolvedFunctionName, functionArguments);
            }
        }
       
        LOG.debug("Executing function call : " + resolvedFunctionName);
       
        Map<String, Variable> paramVariables = assignParameters(
            function,
            functionArguments,
            executionState);
        DispelExecutionState functionExecutionState =
            SimpleDispelExecutionState.makeFunctionScope(
                executionState,
                paramVariables,
                function.getNamespaceManager());
       
        RootStrategy body = new RootStrategy(
            registry,
            optimiser,
            functionExecutionState);
       
        DISPELRequestBuilder old = compiler.getRequestBuilder();
       
        DISPELGraphBuilder builder = new DISPELGraphBuilder(body);
        builder.setCompiler(compiler);
        compiler.handleChild(function.getBody(), builder);
        Object result = body.getFunctionResult();
        LOG.debug("result of function call : " + result);

        // add submitted and registered objects to the original request builder
        // do we need a better way of doing this?
View Full Code Here

      {
          return null;
      }
     
      compile(functionName, details, executionState, registry, optimiser);
        Function result = executionState.getFunctions().get(functionName);
       
        LOG.debug("Result is: " + result);
       
        return result;
View Full Code Here

        }
        LOG.debug("Compilation complete for object: " + object.getName());

        // Write the functions obtained to our function store
        executionState.getFunctions().putAll(builder.getFunctions());
        Function function = builder.getFunctions().get(object.getName());
        if (function != null)
        {
            // put the function into the map under the alias
            executionState.getFunctions().put(name, function);
            LOG.debug("Added function " + name + " = " + function);
View Full Code Here

//            System.out.println("FUNCTIONS: " + mFunctions);
//            System.out.println("VARIABLES: " + mVariables);
//            System.out.println("REGISTRY:  " + mRegistry);
            break;
        case FUNCTION:
            Function function = ((FunctionStrategy)strategy).getFunction();
            mExecutionState.getFunctions().put(function.getName(), function);
            break;
        case VARIABLE_DECLARATION:
        {
            VariableDeclarationStrategy var =
                (VariableDeclarationStrategy)strategy;
View Full Code Here

        catch (UnknownTypeException e)
        {
            // it's not a type so check if it's a function
            if (mExecutionState.getFunctions().containsKey(qName))
            {
                Function function = mExecutionState.getFunctions().get(qName);
                reg = new RegisteredObject(qName, function);
            }
            else
            {
                // see if it's a variable, so we're registering an object
View Full Code Here

    @Override
    public Function getFunction(
        String functionName, List<Expression> functionArguments)
        throws UndefinedFunctionException
    {
        Function function = mFunctions.get(functionName);
        if (function == null)
        {
            throw new UndefinedFunctionException(
                functionName, functionArguments);
        }
View Full Code Here

        break;
        case FUNCTION:
        {
            SimpleFunctionDescriptor descriptor =
                new SimpleFunctionDescriptor(object.getName());
            Function function = (Function)object.getMetadata();
            for (Entry<Integer, String> index : function.getIndices().entrySet())
            {
                Type type = function.getParameters().get(index.getValue());
                Parameter parameter = getDescriptor(
                        type,
                        function.getArrayDimensions().get(index.getValue()));
                parameter.setIndex(index.getKey());
                descriptor.addParameter(index.getValue(), parameter);
            }
            descriptor.setReturnType(
                    getDescriptor(
                            function.getReturnType(),
                            function.getReturnTypeArray()));
            URI uri = null;
            try
            {
                uri = storeImplementation(object.getDispel());
                descriptor.setLocation(uri);
View Full Code Here

     *            known processing elements etc.
     */
    public FunctionStrategy(ContextStrategy parent, DispelExecutionState executionState)
    {
        super(parent);
        mFunction = new Function();
        mExecutionState = executionState;
    }
View Full Code Here

TOP

Related Classes of eu.admire.dispel.parser.types.Function

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.