Package eu.admire.dispel.parser.v4.builder

Examples of eu.admire.dispel.parser.v4.builder.TupleTypeStrategy


    private StringBuilder mError = new StringBuilder();
    private AdmireRegistry mRegistry;
   
    public void process(String dispel) throws IOException
    {
        DISPELCompiler compiler = new DISPELCompiler();
        DISPELGraphBuilder builder = new DISPELGraphBuilder(
                mRegistry,
                new SimpleDispelOptimiser());
        compiler.setRequestBuilder(builder);
        compiler.addErrorListener(this);
        compiler.parse(dispel);

        Map<String, RegisteredObject> registered = builder.getRegistered();
        Map<String, Variable> variables = builder.getDispelExecutionState().getVariables();
       
        for (Entry<String, RegisteredObject> entry : registered.entrySet())
View Full Code Here



    public DISPELGraphBuilder runDISPEL(Reader reader)
    throws IOException, RecognitionException
    {
        DISPELCompiler compiler = new DISPELCompiler();
        compiler.addErrorListener(this);
        DISPELGraphBuilder builder = new DISPELGraphBuilder(
           mRegistry, new SimpleDispelOptimiser());
        compiler.setRequestBuilder(builder);
        compiler.parse(reader);
        return builder;
    }
View Full Code Here

    public void testSimpleGraph() throws Exception
    {
        String path = PATH + "simple_graph.dispel";
        BufferedReader reader = new BufferedReader(new FileReader(path));
        DISPELCompiler compiler = new DISPELCompiler();
        compiler.addErrorListener(this);
        DISPELGraphBuilder builder = new DISPELGraphBuilder(
            mRegistry, new SimpleDispelOptimiser());
        compiler.setRequestBuilder(builder);
        compiler.parse(reader);
        assertNull(mError);
        Collection<Graph> graphs = builder.getSubmittedGraphs();
        assertEquals(1, graphs.size());
        List<RequestNode> nodes = graphs.iterator().next().getNodes();
        assertEquals(6, nodes.size());
View Full Code Here

        return runDISPEL(reader);
    }
   
    public DISPELGraphBuilder runDISPEL(Reader reader) throws IOException
    {
        DISPELCompiler compiler = new DISPELCompiler();
        compiler.addErrorListener(this);
        DISPELGraphBuilder builder = new DISPELGraphBuilder(
            mRegistry, new SimpleDispelOptimiser());
        compiler.setRequestBuilder(builder);
        compiler.parse(reader);
        return builder;
    }
View Full Code Here

        {
            CompilationException exc = new CompilationException();
            exc.initCause(new NoDispelException(object));
            throw exc;
        }
        DISPELCompiler compiler = new DISPELCompiler();
        DISPELGraphBuilder builder = new DISPELGraphBuilder(registry, optimiser);
           
        compiler.setRequestBuilder(builder);
        builder.setCompiler(compiler);
        SimpleErrorListener listener = new SimpleErrorListener();
        compiler.addErrorListener(listener);
        compiler.parse(object.getDispel());
       
        if (listener.getError() != null)
        {
            CompilationException exc = new CompilationException();
            exc.initCause(listener.getError());
View Full Code Here

        System.out.println(dot);
    }
   
    public void testFunctionCreatingPE() throws Exception
    {
        DISPELCompiler compiler = new DISPELCompiler();
        InMemoryAdmireRegistry registry = new InMemoryAdmireRegistry();
        registry.registerProcessingElement("eu.admire.Results");
        registry.registerProcessingElement("uk.org.ogsadai.Echo");
        DISPELGraphBuilder builder =
            new DISPELGraphBuilder(registry, new SimpleDispelOptimiser());
        compiler.setRequestBuilder(builder);
        compiler.parse(new FileReader(DISPEL_PATH + "FunctionCreatingPE.dispel"));
        assertTrue(!builder.getSubmittedGraphs().isEmpty());
        Graph graph = builder.getSubmittedGraphs().iterator().next();
        String dot = DotGenerator.generate(graph);
        System.out.println(dot);
//        writeFile(dot);
View Full Code Here

            RequestContext context, Graph graph, RequestNode node, String impl)
        throws TransformationException
    {
        DISPELGraphBuilder builder =
            new DISPELGraphBuilder(mAdmireRegistry, mDispelOptimiser);
        DISPELCompiler compiler = new DISPELCompiler();
        compiler.setRequestBuilder(builder);
        SimpleErrorListener errorListener = new SimpleErrorListener();
        compiler.addErrorListener(errorListener);
        compiler.parse(impl);
        if (errorListener.haveErrors())
        {
            throw new TransformationException(
                    "Implementation of processing element '" +
                    node.getName() + "' cannot be parsed.");
View Full Code Here

        }       
    }

    public DISPELGraphBuilder runDISPEL(Reader reader) throws IOException
    {
        DISPELCompiler compiler = new DISPELCompiler();
        compiler.addErrorListener(this);
        DISPELGraphBuilder builder = new DISPELGraphBuilder(
            mRegistry, new SimpleDispelOptimiser());
        compiler.setRequestBuilder(builder);
        compiler.parse(reader);
        return builder;
    }
View Full Code Here

    public void testDuplicateConnection() throws Exception
    {
        InMemoryAdmireRegistry registry = new InMemoryAdmireRegistry();
        registry.registerProcessingElement("a.A");
        registry.registerProcessingElement("eu.admire.Results");
        DISPELCompiler compiler = new DISPELCompiler();
        DISPELGraphBuilder builder =
            new DISPELGraphBuilder(registry, new SimpleDispelOptimiser());
        compiler.setRequestBuilder(builder);
        compiler.addErrorListener(new ErrorListener()
        {
            @Override
            public void error(int line, int column, Throwable cause)
            {
                System.out.println("(" + line + ", " + column + ")");
                cause.printStackTrace();
            }
            @Override
            public void error(int line, int column, String message)
            {
                System.out.println("(" + line + ", " + column + "): " + message);
            }
        });
        compiler.parse("use a.A; " +
            "A a1 = new A; A a2 = new A; " +
            "a1.output => a2.input; a1.output => a2.input; " +
            "submit a1;");
        Collection<Graph> submitted = builder.getSubmittedGraphs();
        assertFalse("Compilation failed", submitted.isEmpty());
View Full Code Here

    public DispelEngineResult processDispel(Reader dispel)
        throws CompilationException,
               TransformationException,
               IOException
    {
        DISPELCompiler compiler = new DISPELCompiler();
       
        for (ErrorListener errorListener : mErrorListeners )
        {
            compiler.addErrorListener(errorListener);
        }
        compiler.addErrorListener(this);
       
        DISPELGraphBuilder builder = new DISPELGraphBuilder(
            mAdmireRegistry, mDispelOptimiser);
        compiler.setRequestBuilder(builder);
        compiler.parse(dispel);
       
        if (mHaveCompilerErrors)
        {
            throw new CompilationException();
        }
View Full Code Here

TOP

Related Classes of eu.admire.dispel.parser.v4.builder.TupleTypeStrategy

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.