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

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


    @Test
    public void testSimple() throws Exception
    {
        String function = "Integer A() { String a = \"xxx\"; Integer x = 1+2*3/5; }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse(mHasError);
        System.out.println(dispel);
    }
View Full Code Here


    @Test
    public void testParameterArray() throws Exception
    {
        String function = "Integer[] A(String[] a) { Integer[][] i = new Integer[2][10]; return i[0]; }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse(mHasError);
        System.out.println(dispel);
    }
View Full Code Here

    @Test
    public void testForLoop() throws Exception
    {
        String function = "void f() { for (Integer i=0; i<2; i++) { } Integer i; for (i=0; i<5; i++) {} }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("f"));
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse(mHasError);
        System.out.println(dispel);
    }
View Full Code Here

    @Test
    public void testPackage() throws Exception
    {
        String function = "package eu.admire { " +
            "Integer A() { String a = \"xxx\"; } }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("eu.admire.A"));
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse(mHasError);
        System.out.println(dispel);
    }
View Full Code Here

    @Test
    public void testReturnPEInstance() throws Exception
    {
        mRegistry.registerProcessingElement("SQLQuery");
        String function = "use SQLQuery; SQLQuery A() { return new SQLQuery; }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse(mHasError);
        System.out.println(dispel);
    }
View Full Code Here

    {
        mRegistry.registerProcessingElement("X");
        String function = "use X; Integer A() { " +
            "X a = new X; X[] b = new X[2]; " +
            "a.out => b[0].in[0]; Connection c; c => b[1].in; a.out => c; }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
        runDISPEL(new StringReader(dispel));
        System.out.println(dispel);
    }
View Full Code Here

    @Test
    public void testReturnConnection() throws Exception
    {
        String function = "Connection A() { " +
                "Connection c; return c; }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse(mHasError);
//        System.out.println(dispel);
    }
View Full Code Here

    @Test
    public void testReturnConnectionArray() throws Exception
    {
        String function = "Connection[] A() { " +
                "Connection[] c = new Connection[2]; return c; }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse(mHasError);
//        System.out.println(dispel);
    }
View Full Code Here

        mRegistry.register("MySType",
                new DispelObject(
                        "MySType",
                        DispelObjectType.STRUCTURAL_TYPE,
                        new StructuralType(new PrimitiveSType("Integer"))));
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
        System.out.println(dispel);
        runDISPEL(new StringReader(dispel));
        TestCase.assertFalse("Function DISPEL cannot be parsed.", mHasError);
    }
View Full Code Here

        mRegistry.registerProcessingElement("SQLQuery");
        String function = "use SQLQuery;" +
            "PE( <Connection expression> => <Connection data>) A() {" +
            "SQLQuery sqlq = new SQLQuery;" +
            "return PE( <> => <Connection data = sqlq.data> ); }";
        DISPELGraphBuilder builder = runDISPEL(new StringReader(function));
        String dispel = FunctionToDISPEL.convert(builder.getFunctions().get("A"));
//        System.out.println(dispel);
    }
View Full Code Here

TOP

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

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.