Package tree.type

Examples of tree.type.HaxeType


    {
        HaxeTree tree = parseModule("class A { function main():Int { return 123.1;}}");
        linker.visit(tree, new Environment());
       
        Return returnNode = getReturnNode(tree);
        HaxeType type = returnNode.getHaxeType();
        Function function = returnNode.getFunction();   
        HaxeType funType = function.getHaxeType();
       
        assertTrue(!TypeUtils.isAvailableAssignement(funType, type));
    }
View Full Code Here


    {
        HaxeTree tree = parseModule("class A { function main():Float { return 123;}}");
        linker.visit(tree, new Environment());
       
        Return returnNode = getReturnNode(tree);
        HaxeType type = returnNode.getHaxeType();
        Function function = returnNode.getFunction();
        HaxeType funType = function.getHaxeType();
       
        assertTrue(TypeUtils.isAvailableAssignement(funType, type));
    }
View Full Code Here

        HaxeTree initialization = node.getInitializationNode();
        if (initialization == null)
        {
            return;
        }
        HaxeType type = node.getHaxeType();
        HaxeType initType = initialization.getHaxeType(true);
        if (type == null || initType == null)
        {
            return;
        }
        if (!TypeUtils.isAvailableAssignement(type, initType))
View Full Code Here

        }
       
        for (HaxeTree child : node.getParameters())
        {
            visit(child, data);
            HaxeType ctype = child.getHaxeType(true);
            if (!ctype.equals(TypeUtils.getInt()))
            {
                ErrorPublisher.commitCastError(child, TypeUtils.getInt());
            }
        }
       
View Full Code Here

            // some member's type was undefined
            return;
        }
        // here we have...member's types are not from the same
        // hierarchy!
        HaxeType type = TypeUtils.getUnknown();
        for (HaxeTree child : node.getChildren())
        {
            HaxeType ctype = child.getHaxeType(true);
            if (child.getChildIndex() == 0)
            {
                type = ctype;
                continue;
            }
View Full Code Here

    }

    @Override
    protected void visit(final Return node, Object data)
    {
        HaxeType type = node.getHaxeType();
        Function function = node.getFunction();
       
        HaxeType funType = function == null
                ? TypeUtils.getVoid() : function.getHaxeType();
        if (!TypeUtils.isAvailableAssignement(funType, type))
        {
            ErrorPublisher.commitCastError(node, funType);
        }
View Full Code Here

        {
            visit(condition, data);
            return;
        }

        HaxeType bool = TypeUtils.getBool();
        if (!condition.getHaxeType().equals(bool))
        {
            ErrorPublisher.commitCastError(condition, bool);
        }
    }
View Full Code Here

        {
            return type1;
        }
       
        // we have to look their hierarchies deeper
        HaxeType typeFromHierarhy = null;
        for (HaxeType type : type1Hierarchy)
        {
            typeFromHierarhy = getCommonPrimaryType(type, type2);
        }
       
View Full Code Here

    }
   
    public static boolean areBothNumbers(
            final HaxeType type,final HaxeType type2)
    {
        HaxeType floatType = getFloat();
       
        // Int have Float in its type hierarchy so if we check
        // just for float it will mean that type can have int
        // as a parent, not just float
        return isAvailableAssignement(floatType, type) &&
View Full Code Here

    }

    @Override
    protected void visit(final Declaration node, Object data)
    {
        HaxeType nodeType = node.getHaxeType();
        if ((searchObject instanceof Class || searchObject instanceof Enum)
                && nodeType != null
                && searchObject.getHaxeType().getShortTypeName().equals(nodeType.getShortTypeName()))
        {
            addToResults(node);
        }
        HaxeTree init = node.getInitializationNode();
        if (init == null)
View Full Code Here

TOP

Related Classes of tree.type.HaxeType

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.