Package tree

Examples of tree.HaxeTree


    protected void visit(Usage node, Object data)
    {
        // search for declaration
        // 1 - local vars - last declared
        String name = node.getText();
        HaxeTree declaration = getDeclaration(data, name);
        // 2 - class member, inherit fields????
        // 3 - curr class static fields???
        // 4 - enums declared
        if (declaration == null)
        {
            // imports
            declaration = getType(name, data);
        }
       
        node.setDeclarationNode(declaration);
       
        // check if it is dotident and CAN have a member
        if (!node.isFieldUse() && !(
                declaration instanceof Class ||
                declaration instanceof Enum)) //+ interface ??
        {
            return;
        }
        HaxeTree child = node.getChild(0).getChild(0);
        // slices and methcalls
        // TODO: here we should send not the Declaration
        // but the HaxeTree found by type name
        if (child instanceof MethodCall ||
                child instanceof Slice)
View Full Code Here


                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

        node.setPackage(currentPackage);
        for (HaxeTree child : node.getChildren())
        {
            if (child.getToken().getType() == HaxeParser.TYPE_TAG)
            {
                HaxeTree cchild = node.getChild(0);
                if (cchild != null)
                {
                    String typeName = cchild.getText();
                    HaxeType type = getType(typeName, data);
                    node.setHaxeType(type);
                }
            }
        }
View Full Code Here

        // class D extends A, implements B, implements C
        for (HaxeTree child : node.getChildren())
        {
            if (child.getType() == HaxeParser.EXTENDS)
            {
                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;
        env.putWithCustomName("this", node);
        HaxeTree inherits = node.getParentToExtend();
        if (inherits != null)
        {
            env.putWithCustomName("super", inherits);
        }
       
View Full Code Here

        if (node.parent instanceof BlockScope)
        {
            node.setIfLastInScope(thisIndex == maxIndex - 1);          
        }
       
        HaxeTree ifBlock = node.getIfBlock();
        HaxeTree elseBlock = node.getElseBlock();
       
        visit(ifBlock, declarations);
       
        if (!node.isLastInScope())
        {
            node.setHaxeType(TypeUtils.getVoid());
            return;
        }
       
        if (elseBlock == null)
        {
            // If there is no else, and the if expression is false,
            // then the entire expression has type Void.
            // TODO check for if expr is false and setting the type accordingly?
            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?
View Full Code Here

      {
        return msg;
      }
    }

    HaxeTree currentAst = (HaxeTree)parseController.getCurrentAst();
    // Otherwise, base the help message on the text that is represented
    // by the help node
    msg = getMessageForNodeClass((HaxeTree)helpNode);
    return msg;
  }
View Full Code Here

    public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
    {
        CodeFilesEditor fragment= (CodeFilesEditor)receiver;
        if ("canRefactor".equals(property))
        {
            HaxeTree node = fragment.getCurrentNode();
            return testCanRefactor(node);
        }
        return false;
    }
View Full Code Here

    }
 
  @Override
  public HaxeType getHaxeType()
  {
      HaxeTree expression = getExpression();
      if (expression == null)
        {
          setHaxeType(TypeUtils.getVoid());
        }
      else
      {
          setHaxeType(expression.getHaxeType());
      }
      return super.getHaxeType();
  }
View Full Code Here

            {
                return;
            }

            CallHierarchyNodeElement methodWrapper = (CallHierarchyNodeElement) structuredSelection;
            HaxeTree node = methodWrapper.getNode();

            if (node != null)
            {
                WorkspaceUtils.jumpToLocation(methodWrapper.getFile(), node);
            }
View Full Code Here

      return pack;
  }
 
  public void updateInfo()
  {
      HaxeTree init = getInitializationNode();
        if (init != null)
        {
            mostRightPosition = init.getMostRightPosition();
        }
      updateInfoFromTags();
      updateModifier();
  }
View Full Code Here

TOP

Related Classes of tree.HaxeTree

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.