Package org.openquark.cal.compiler.SourceModel

Examples of org.openquark.cal.compiler.SourceModel.SourceElement


        CodeGem gem = createCodeGem("x + y");
        burnArg(gem, 0, "x");
        burnArg(gem, 1, "y");
        reorderArgs(gem, new int[] {1, 0});
       
        SourceElement element = createFunctionDefn("", "\\y x -> x + y");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here


        Gem absGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.abs);
        gemGraph.addGem(absGem);
       
        connect(gemGraph, absGem, gem, 1, "y");
       
        SourceElement element = createFunctionDefn("x_1", "\\x -> (\\y -> x + y) (" + CAL_Prelude.Functions.abs.getQualifiedName() + " x_1)");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        Gem absGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.abs);
        gemGraph.addGem(absGem);
       
        connect(gemGraph, absGem, gem, 1, "b");
       
        SourceElement element = createFunctionDefn("a x c d", "(\\b -> (a, b, c, d)) (" + CAL_Prelude.Functions.abs.getQualifiedName() + " x)");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

    public void testTuple4CodeGem_BurntTwoInputs() {
        CodeGem gem = createCodeGem("(a, b, c, d)");
        burnArg(gem, 0, "a");
        burnArg(gem, 2, "c");
       
        SourceElement element = createFunctionDefn("b d", "\\a c -> (a, b, c, d)");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        CodeGem gem = createCodeGem("(a, b, c, d)");
        burnArg(gem, 0, "a");
        burnArg(gem, 2, "c");
        reorderArgs(gem, new int[] {1, 3, 0, 2});
       
        SourceElement element = createFunctionDefn("b d", "\\a c -> (a, b, c, d)");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        CodeGem gem = createCodeGem("(a, b, c, d)");
        burnArg(gem, 0, "a");
        burnArg(gem, 2, "c");
        reorderArgs(gem, new int[] {2, 0, 3, 1});
       
        SourceElement element = createFunctionDefn("d b", "\\c a -> (a, b, c, d)");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        Gem absGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.abs);
        gemGraph.addGem(absGem);
       
        connect(gemGraph, absGem, gem, 1, "b");
       
        SourceElement element = createFunctionDefn("x d", "\\a c -> (\\b -> (a, b, c, d)) (" + CAL_Prelude.Functions.abs.getQualifiedName() + " x)");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        Gem list2Gem = gemFactory.makeFunctionalAgentGem(CAL_List.Functions.list2);
        gemGraph.addGem(list2Gem);
       
        connect(gemGraph, gem, list2Gem, 1, "item2");
       
        SourceElement element = createFunctionDefn("item1 a b c d", CAL_List.Functions.list2.getQualifiedName() + " item1 (a, b, c, d)");
       
        assertFunctionTextEquals(list2Gem, element);
    }
View Full Code Here

        Gem list2Gem = gemFactory.makeFunctionalAgentGem(CAL_List.Functions.list2);
        gemGraph.addGem(list2Gem);
       
        connect(gemGraph, gem, list2Gem, 1, "item2");
       
        SourceElement element = createFunctionDefn("item1 d b", CAL_List.Functions.list2.getQualifiedName() + " item1 (\\c a -> (a, b, c, d))");
       
        assertFunctionTextEquals(list2Gem, element);
    }
View Full Code Here

        Gem list2Gem = gemFactory.makeFunctionalAgentGem(CAL_List.Functions.list2);
        gemGraph.addGem(list2Gem);
       
        connect(gemGraph, gem, list2Gem, 1, "item2");
       
        SourceElement element = createFunctionDefn("item1 b d", CAL_List.Functions.list2.getQualifiedName() + " item1 (\\a c -> (a, b, c, d))");
       
        assertFunctionTextEquals(list2Gem, element);
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.SourceModel.SourceElement

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.