Examples of SourceElement


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

    //
   
    public void testSimpleCodeGem() {
        CodeGem gem = createCodeGem("x + y");
       
        SourceElement element = createFunctionDefn("x y", "x + y");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

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

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

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

            .replaceAll("%x", "x").replaceAll("%y", "y"));
       
        renameArg(gem, 0, "x", "a");
        renameArg(gem, 1, "y", "b");
       
        SourceElement element = createFunctionDefn("a b", code
            .replaceAll("%x", "a").replaceAll("%y", "b"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

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

       
        renameArg(gem, 0, "x", "a");
        renameArg(gem, 1, "y", "b");
        reorderArgs(gem, new int[] {1, 0});
       
        SourceElement element = createFunctionDefn("b a", code
            .replaceAll("%x", "a").replaceAll("%y", "b"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

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

   
    public void testSimpleCodeGem_BurntInput1() {
        CodeGem gem = createCodeGem("x + y");
        burnArg(gem, 1, "y");
       
        SourceElement element = createFunctionDefn("x", "\\y -> x + y");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

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

    public void testSimpleCodeGem_BurntInput0() {
        CodeGem gem = createCodeGem("x + y");
        burnArg(gem, 0, "x");
       
        SourceElement element = createFunctionDefn("y", "\\x -> x + y");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

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

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

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

    public void testSimpleCodeGem_BurntAllInputs() {
        CodeGem gem = createCodeGem("x + y");
        burnArg(gem, 0, "x");
        burnArg(gem, 1, "y");
       
        SourceElement element = createFunctionDefn("", "\\x y -> x + y");
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.