Package tree.expression

Examples of tree.expression.Binary


    }
   
    @Test
    public void testBinOpPriority2() throws RecognitionException {
        HaxeTree tree = parseExpression("z && x != y");
        Binary binaryNode = (Binary)tree;
        assertTrue(binaryNode.getLeftOperand() instanceof Usage);
        assertTrue(binaryNode.getRightOperand() instanceof Binary);
    }
View Full Code Here


    }
   
    @Test
    public void testBinOpPriority3() throws RecognitionException {
        HaxeTree tree = parseExpression("z <= x|y");
        Binary binaryNode = (Binary)tree;
        assertTrue(binaryNode.getLeftOperand() instanceof Usage);
        assertTrue(binaryNode.getRightOperand() instanceof Binary);
    }
View Full Code Here

    }
   
    @Test
    public void testBinOpPriority8() throws RecognitionException {
        HaxeTree tree = parseExpression("z ... x >= y");
        Binary binaryNode = (Binary)tree;
        assertTrue(binaryNode.getLeftOperand() instanceof Usage);
        assertTrue(binaryNode.getRightOperand() instanceof Binary);
    }
View Full Code Here

    }
   
    @Test
    public void testBinOpPriority4() throws RecognitionException {
        HaxeTree tree = parseExpression("z | x << y");
        Binary binaryNode = (Binary)tree;
        assertTrue(binaryNode.getLeftOperand() instanceof Usage);
        assertTrue(binaryNode.getRightOperand() instanceof Binary);
    }
View Full Code Here

    }
   
    @Test
    public void testBinOpPriority5() throws RecognitionException {
        HaxeTree tree = parseExpression("z << x + y");
        Binary binaryNode = (Binary)tree;
        assertTrue(binaryNode.getLeftOperand() instanceof Usage);
        assertTrue(binaryNode.getRightOperand() instanceof Binary);
    }
View Full Code Here

    }
   
    @Test
    public void testBinOpPriority6() throws RecognitionException {
        HaxeTree tree = parseExpression("z << x + y");
        Binary binaryNode = (Binary)tree;
        assertTrue(binaryNode.getLeftOperand() instanceof Usage);
        assertTrue(binaryNode.getRightOperand() instanceof Binary);
    }
View Full Code Here

    }
   
    @Test
    public void testBinOpPriority7() throws RecognitionException {
        HaxeTree tree = parseExpression("z - x * y");
        Binary binaryNode = (Binary)tree;
        assertTrue(binaryNode.getLeftOperand() instanceof Usage);
        assertTrue(binaryNode.getRightOperand() instanceof Binary);
    }
View Full Code Here

            one(mockClass).getStandartTypeByName("Int");
            will(returnValue(intType));
        } });
        HaxeTree tree = parseFunction("function main() { var x; x=123 + 1; }");
        linker.visit(tree, new Environment());
        Binary node = TestHelper.getBinaryExpression(tree);
       
        assertTrue(node.getHaxeType() == TypeUtils.getInt());
    }
View Full Code Here

    @Test
    public void testFloatAfterAdditionExpectiong() throws RecognitionException
    {
        HaxeTree tree = parseFunction("function main() { var x; x=123.1 + 1; }");
        linker.visit(tree, new Environment());
        Binary node = TestHelper.getBinaryExpression(tree);
       
        assertTrue(node.getHaxeType() == TypeUtils.getFloat());
    }
View Full Code Here

    @Test
    public void testStringAfterAdditionExpectiong() throws RecognitionException
    {
        HaxeTree tree = parseFunction("function main() { var x; x=123 + \" monkeys\"; }");
        linker.visit(tree, new Environment());
        Binary node = TestHelper.getBinaryExpression(tree);
       
        assertTrue(node.getHaxeType() == TypeUtils.getString());
    }
View Full Code Here

TOP

Related Classes of tree.expression.Binary

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.