Package tree

Examples of tree.HaxeTree


      }
      if (isNodeValidForUsageAnalysis(supposedNode))
      {
        return supposedNode;
      }
      HaxeTree node = null;
      if (supposedNode instanceof Usage)
      {
          return ((Usage)supposedNode).getDeclarationNode();
      }
      // TODO getValidNodeForUsageAnalysis - what to do with DotIdents?
View Full Code Here


      {
        return supposedNode;
      }
      if (supposedNode instanceof Class)
      {
          HaxeTree node = ((Class)supposedNode).getConstructor();
            return getValidNodeForCallAnalysis(node);
      }
      if (supposedNode instanceof NewNode)
      {
        // TODO by our logic here we should return function - not the
        // class or type
        HaxeTree node = ((NewNode)supposedNode).getObjectWhichIsCreated();
        return getValidNodeForCallAnalysis(node);
      }
      if (supposedNode instanceof MethodCall)
      {
        HaxeTree node = ((MethodCall)supposedNode).getDeclarationNode();
        return getValidNodeForCallAnalysis(node);
      }
      return getValidNodeForCallAnalysis(supposedNode.getParent());
    }
View Full Code Here

    {
        if (currentAST == null)
        {
            return null;
        }
        HaxeTree result = null;
        for (HaxeTree child : currentAST.getChildren())
        {
            result = getNodeByOffset(offset, length, child);
            if (result != null)
            {
                return result;
            }
        }
        if (currentAST.getMostLeftPosition() <= offset &&
                currentAST.getMostRightPosition() >= offset + length)
        {
            HaxeTree parent = currentAST.getParent();
            if (parent != null
                    && ( parent instanceof MethodCall || parent instanceof Slice))
            {
                return parent;
            }
View Full Code Here

*/
public class OutlineLabelProvider extends AbstractLabelProvider
{
  public String getText(final Object element)
  {
    HaxeTree n = (element instanceof ModelTreeNode) ? (HaxeTree) ((ModelTreeNode) element)
        .getASTNode()
        : (HaxeTree) element;

    return getLabelForHaxeTreeNode(n);
  }
View Full Code Here

                && nodeType != null
                && searchObject.getHaxeType().getShortTypeName().equals(nodeType.getShortTypeName()))
        {
            addToResults(node);
        }
        HaxeTree init = node.getInitializationNode();
        if (init == null)
        {
            return;
        }
        visit (init, data);
View Full Code Here

    }

    @Override
    protected void visit(final NewNode node, Object data)
    {
        HaxeTree declaration = node.getDeclarationNode();
        if (declaration != null
                && searchObject instanceof Class
                // TODO check parameter types and so
                && declaration.getText().equals(searchObject.getText()))
        {
            addToResults(node);
        }
       
        // now visit the params if there are any
View Full Code Here

    }

    @Override
    protected void visit(final MethodCall node, Object data)
    {
        HaxeTree parent = node.getParent();
        HaxeTree decl = node.getDeclarationNode();
        if ((searchObject instanceof Function
                || parent instanceof NewNode) // for constructors
                && decl != null
                && decl.equals(searchObject))
        {
            addToResults(node);
        }
       
        for (HaxeTree param : node.getParameters())
View Full Code Here

        {
            addToResults(node);
        }
        if (node.isFieldUse())
        {
            HaxeTree child = node.getChild(0).getChild(0);
            visit(child, data);
        }
    }
View Full Code Here

    private void doParse(final String contents) {
        HaxeLexer lexer = new HaxeLexer(new ANTLRStringStream(contents));
        tokenStream = new CommonTokenStream(lexer);
        //this.tokenStream.getTokens();
        System.out.print("Parsing file...");
        currentAST = new HaxeTree();

        try
        {
            currentAST = WorkspaceUtils.parseFileContents(tokenStream);
            System.out.println("success!");
View Full Code Here

        return putWithCustomName(name, declaration);
    }
   
    public boolean putWithCustomName(String name, HaxeTree declaration)
    {
        HaxeTree decl = get(name);
        if (decl == null)
        {
            super.put(name, declaration);
            return true;
        }
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.