Examples of HaxeType


Examples of tree.type.HaxeType

      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

Examples of tree.type.HaxeType

    }
  }
 
  protected String typeToString()
  {
      HaxeType type = getHaxeType();
      return type == null ? "null" : type.getShortTypeName();
  }
View Full Code Here

Examples of tree.type.HaxeType

    {
        if (operationType == null || leftType == null || rightType == null)
        {
            return null;
        }
        HaxeType intType = TypeUtils.getInt();
        switch (operationType)
        {
            //If both expressions are Int then return Int, else if both
            //expressions are either Int or Float then return Float, else return String.
            case PLUS:
                if (leftType.equals(intType) && rightType.equals(intType))
                {
                    return intType;
                }
                HaxeType floatType = TypeUtils.getFloat();
                if ((leftType.equals(intType) || rightType.equals(intType)) &&
                        (leftType.equals(floatType) || rightType.equals(floatType)))
                {
                    return floatType;
                }
                return TypeUtils.getString();
            //Divide two numbers, return Float.
            case DIVIDE:
                if (TypeUtils.areBothNumbers(leftType, rightType))
                {
                    return TypeUtils.getFloat();
                }
                break;
            // Return Int if both are Int and return Float
            // if they are either both Float or mixed.
            case NUMERABLE:
                if (TypeUtils.areBothNumbers(leftType, rightType))
                {
                    return TypeUtils.getCommonPrimaryType(leftType, rightType);
                }
                break;
            // bitwise operations between two Int expressions. Returns Int.
            case BITWISE:
                if (leftType.equals(intType) && rightType.equals(intType))
                {
                    return intType;
                }
                break;
            //perform normal or physical comparisons between two
            //expressions sharing a common type. Returns Bool.
            //TODO we can compare two strings ???????
            case COMPARISON:
                if (TypeUtils.isComparable(leftType, rightType))
                {
                    return TypeUtils.getBool();
                }
                break;
            //Both e1 and e2 must be Bool
            case BOOLEAN:
                HaxeType bool = TypeUtils.getBool();
                if (leftType.equals(bool) && rightType.equals(bool))
                {
                    return leftType;
                }
                break;
View Full Code Here

Examples of tree.type.HaxeType

     * for that operation or NULL (!) if they are not.
     */
    public HaxeType defineResultType()
    {
        BoolOperations operationType = getOperationType();
        HaxeType leftType = getLeftOperand().getHaxeType();
        HaxeType rightType = getRightOperand().getHaxeType();
       
        return super.defineResultType(operationType, leftType, rightType);
    }
View Full Code Here

Examples of tree.type.HaxeType

     * for that operation or NULL (!) if they are not.
     */
    public HaxeType defineResultType()
    {
        BoolOperations operationType = getOperationType();
        HaxeType leftType = getLeftOperand().getHaxeType();
        HaxeType rightType = getRightOperand().getHaxeType();
       
        return super.defineResultType(operationType, leftType, rightType);
    }
View Full Code Here

Examples of tree.type.HaxeType

        HaxeTree expr = getExpression();
        if (getExpression() == null || token == null)
        {
            return;
        }
        HaxeType exprType = expr.getHaxeType();
        if (exprType == null)
        {
            return;
        }
        UnarOperations opType = getOperationTypeByToken(token.getText());
View Full Code Here

Examples of tree.type.HaxeType

    @Override
    public HaxeType getHaxeType()
    {
        if (haxeType == null)
        {
            HaxeType arrayType = TypeUtils.getArray();
            if (arrayType == null || !(arrayType instanceof Class))
            {
                return null;
            }
            ((Class)arrayType).addToParamTypes(getMembersType());
View Full Code Here

Examples of tree.type.HaxeType

    }
   
    private void tryDefineType()
    {
        // for empty arrays
        HaxeType type = TypeUtils.getUnknown();
        for (HaxeTree child : getChildren())
        {
            if (child.getChildIndex() == 0)
            {
                type = child.getHaxeType();
                continue;
            }
            if (child.isUndefinedType())
            {
                // it will leave type of the array as Undefined
                return;
            }
            HaxeType ctype = child.getHaxeType();
            if (TypeUtils.isAvailableAssignement(type, ctype))
            {
                continue;
            }
            else if (TypeUtils.isAvailableAssignement(ctype, type))
View Full Code Here

Examples of tree.type.HaxeType

  public Constant(
          final int ttype, final Token token, final String varType)
  {
      this(token);
    HaxeType constantType = TypeUtils.getStandartTypeByName(varType);
    if (constantType == null)
    {
      setHaxeType(null);
    }
    else
View Full Code Here

Examples of tree.type.HaxeType

        if (INVALID_NAMES.contains(newName))
        {
            return RefactoringStatus.createFatalErrorStatus("New is invalid");
        }
        // Parent class name the same as new var name
        HaxeType type = TreeUtils.getParentType(targetNode);
        HaxeTree decl = type.getDeclaration(newName);
        if (decl != null)
        {
            boolean answer = showConfirmDialog(
                    "Name collision",
                    "Some other variable have the same name, are you still want to rename?");
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.