Package tree.type

Examples of tree.type.HaxeType


            Environment env = (Environment)data;
            decl = env.get(text);
        }
        else if (data instanceof HaxeType)
        {
            HaxeType clas = (HaxeType) data;
            decl = clas.getDeclaration(text);
        }
       
        return decl;
    }
View Full Code Here


        if (!(local instanceof Environment))
        {
            return null;
        }
        Environment env = (Environment)local;
        HaxeType thisType = (HaxeType)env.get("this");
        // only classes can have type params
        if (thisType instanceof Class)
        {
            Class cclass = (Class)thisType;
            // 1. search in current class type params
            for (HaxeType type : cclass.getParameterTypes())
            {
                if (type.getText().equals(shortTypeName))
                {
                    return type;
                }
            }
        }
        HaxeType result = null;
        if (!isLibProject)
        {
            // 2. search in Standart Types
            result = TypeUtils.getStandartTypeByName(shortTypeName);
            if (result != null)
View Full Code Here

        HaxeTree rightNode = node.getRightOperand();
       
        visit(leftNode, declarations);
        visit(rightNode, declarations);
       
        HaxeType definedType = node.defineResultType();
        if (definedType != null)
        {
            node.setHaxeType(definedType);
        }
    }
View Full Code Here

        }
       
        if (data instanceof Environment)
        {
            Environment declarations = (Environment)data;
            HaxeType currClass = (HaxeType)declarations.get("this");
            declaration = currClass.getDeclaration(node.getText());
        }
        else if (data instanceof HaxeType)
        {
            declaration = ((HaxeType) data).getDeclaration(node.getChild(0).getText());
        }
       
        if ( declaration == null || !(declaration instanceof Function))
        {
            return;
        }
       
        List<Declaration> declParams =
                ((Function)declaration).getParametersAsDeclarations();
       
        // TODO: whtat about optional params?
        if (declParams.size() != params.size())
        {
            return;
        }
       
        for (int i = 0; i < params.size(); i++)
        {
            HaxeType ctype = params.get(i).getHaxeType(true);
            HaxeType dType = declParams.get(i).getHaxeType(true);
            if (ctype != null && !ctype.equals(dType))
            {
                return;
            }
        }
View Full Code Here

                continue;
            }
            if (tree instanceof TypeTag && tree.getChildCount() != 0)
            {
                String typeName = tree.getChild(0).getText();
                HaxeType type = getType(typeName, declarations);
                node.setHaxeType(type);
            }
        }

        node.updateInfo();
        HaxeTree initialization = node.getInitializationNode();
        if (initialization == null)
        {
            return;
        }
        visit(initialization, declarations);
        HaxeType type = node.getHaxeType();
        if (type == null)
        {
            node.setHaxeType(initialization.getHaxeType(true));
        }
    }
View Full Code Here

            {
                HaxeTree cchild = node.getChild(0);
                if (cchild != null)
                {
                    String typeName = cchild.getText();
                    HaxeType type = getType(typeName, data);
                    node.setHaxeType(type);
                }
            }
        }
        currentScope = ScopeTypes.Function;
View Full Code Here

                HaxeTree found = child.getChild(0);
                if (found == null)
                {
                    continue;
                }
                HaxeType type = getType(found.getText(), data);
                node.setParentToExtend(type);
                node.addToTypeHierarchy(type);
            }
            if (child.getType() == HaxeParser.IMPLEMENT_LIST)
            {
                for (HaxeTree impl : child.getChildren())
                {
                    if (impl == null)
                    {
                        continue;
                    }
                    HaxeType type = getType(impl.getText(), data);
                    node.addToTypeHierarchy(type);
                }
            }
        }
        Environment env = (Environment)data;
View Full Code Here

            return;
        }
       
        visit(elseBlock, declarations);
       
        HaxeType type = ifBlock.getHaxeType();
        HaxeType elseType = elseBlock.getHaxeType();
        if (elseType != null && elseType.equals(type))
        {
            // If there is an else, then expr-1 and expr-2 must be of the same type and
            // this will be the type of the if expression
            // TODO: maybe equals not the right part - available assignment?
            node.setHaxeType(type);         
View Full Code Here

      if (node == null)
      {
          return null;
      }
     
      HaxeType type = node.getHaxeType();
      String typeName = "null";
      if (type != null)
      {
          typeName = type.isHaxeLibType()
              ? type.getShortTypeName()
                : type.getFullTypeName();
      }
      return  typeName +  " " + node.getText();
  }
View Full Code Here

    }
  }
 
  protected String typeToString()
  {
      HaxeType type = getHaxeType();
      return type == null ? "null" : type.getShortTypeName();
  }
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.