Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ASTNode


    else
      throw new UnsupportedOperationException("Can't determine results for instruction: " + instr);
  }

  public LE getResultsBefore(final TACInstruction instr) {
    ASTNode node = instr.getNode();
    // get regular results before looking up root instruction
    // to switch to surrounding method, if necessary
    // (driver.tac could be null or outdated otherwise)
    final LE nodeResults = getResultsBefore(node);
    final TACInstruction rootInstr = this.driver.tac.instruction(node);
View Full Code Here


    else
      throw new UnsupportedOperationException("Can't determine results for instruction: " + instr);
  }

  public IResult<LE> getLabeledResultsAfter(final TACInstruction instr) {
    ASTNode node = instr.getNode();
    // get regular results before looking up root instruction
    // to switch to surrounding method, if necessary
    // (driver.tac could be null or outdated otherwise)
    final IResult<LE> nodeResults = getLabeledResultsAfter(node);
    final TACInstruction rootInstr = this.driver.tac.instruction(node);
View Full Code Here

    else
      throw new UnsupportedOperationException("Can't determine results for instruction: " + instr);
  }

  public IResult<LE> getLabeledResultsBefore(final TACInstruction instr) {
    ASTNode node = instr.getNode();
    // get regular results before looking up root instruction
    // to switch to surrounding method, if necessary
    // (driver.tac could be null or outdated otherwise)
    final IResult<LE> nodeResults = getLabeledResultsBefore(node);
    final TACInstruction rootInstr = this.driver.tac.instruction(node);
View Full Code Here

   
    Map<ICompilationUnit, ASTNode> parsedCompilationUnits = new HashMap<ICompilationUnit, ASTNode>();
     Iterator<ICompilationUnit> iter = compilationUnits.iterator();
     ICompilationUnit compUnit = null;
     ASTParser parser = null;
     ASTNode node = null;
     for(; iter.hasNext() ;) {
       compUnit = iter.next();
        parser = ASTParser.newParser(AST.JLS3);
       parser.setResolveBindings(true);
       parser.setSource(compUnit);
View Full Code Here

    Set<ICompilationUnit> compUnits = compilationUnitToASTNode.keySet();
    Iterator<ICompilationUnit> compUnitIterator = compUnits.iterator();
    ICompilationUnit icu;
    for(;compUnitIterator.hasNext();){
      icu = compUnitIterator.next();
      ASTNode node = compilationUnitToASTNode.get(icu);
      node.accept(new BindingsCollectorVisitor(bindings));
    }
    return bindings;
  }
View Full Code Here

   */
  private static <NODETYPE extends ASTNode> Option<NODETYPE>
    findNodeForModel(IMember model_element, final Class<? extends NODETYPE> clazz,
      final Lambda<NODETYPE,Boolean> isCorrectNode) {
    ICompilationUnit comp_unit = model_element.getCompilationUnit();
    ASTNode node = getASTNodeFromCompilationUnit(comp_unit);
   
    // Now, find the corresponding type node
    final Box<NODETYPE> result = new Box<NODETYPE>(null);
    node.accept(new ASTVisitor() {
     
      @Override
      public void postVisit(ASTNode node) {
        // If this node is a subtype of the node we are
        // interested in, then we can ask the client's
        // function if this is the right instance.
        if( clazz.isAssignableFrom(node.getClass()) ) {
          @SuppressWarnings("unchecked") NODETYPE node2 = (NODETYPE)node;
          if( isCorrectNode.call(node2) ) {
            result.setValue(node2);
          }
        }
View Full Code Here

    logger.fine("Reporting problem to user: " + problemDescription + "; node: " + node);
    regressionLogger.info(problemDescription);
    regressionLogger.info(node.toString());

    IResource resource = null;
    ASTNode root = node.getRoot();
    String prefix = null;

    // Identify the closest resource to the ASTNode,
    // otherwise fall back to using the high-level workspace root.
    if (root != null && root.getNodeType() == ASTNode.COMPILATION_UNIT) {
      CompilationUnit cu = (CompilationUnit) root;
      IJavaElement je = cu.getJavaElement();
      resource = je.getResource();
      // print type root name into message if no resource
      prefix = resource == null ?
View Full Code Here

      regressionLogger.info(problemDescription);
      regressionLogger.info(node.toString());
    }

    IResource resource;
    ASTNode root = node.getRoot();

    // Identify the closest resource to the ASTNode,
    // otherwise fall back to using the high-level workspace root.
    if (root.getNodeType() == ASTNode.COMPILATION_UNIT) {
      CompilationUnit cu = (CompilationUnit) root;
      IJavaElement je = cu.getJavaElement();
      resource = je.getResource();
    }
    else {
View Full Code Here

   */
  private ClassInstanceCreation getColumnModelCreation(boolean ensure) throws Exception {
    if (!(getCreationSupport() instanceof ConstructorCreationSupport)) {
      return null;
    }
    ASTNode gridCreation = getCreationSupport().getNode();
    List<Expression> arguments = DomGenerics.arguments(gridCreation);
    for (Expression argument : arguments) {
      if (AstNodeUtils.isSuccessorOf(argument, "com.extjs.gxt.ui.client.widget.grid.ColumnModel")) {
        ExecutionFlowDescription flowDescription =
            JavaInfoUtils.getState(this).getFlowDescription();
        while (true) {
          if (argument instanceof ClassInstanceCreation) {
            return (ClassInstanceCreation) argument;
          }
          if (AstNodeUtils.isVariable(argument)) {
            ASTNode lastAssignment =
                ExecutionFlowUtils.getLastAssignment(flowDescription, argument);
            if (lastAssignment instanceof VariableDeclaration) {
              VariableDeclaration variableDeclaration = (VariableDeclaration) lastAssignment;
              argument = variableDeclaration.getInitializer();
              continue;
View Full Code Here

    if (!columnsList.getIdentifier().equals(possibleName.getIdentifier())) {
      return false;
    }
    // there should be no re-assignment of "columnsList"
    ExecutionFlowDescription flowDescription = JavaInfoUtils.getState(this).getFlowDescription();
    ASTNode columnsAssignment = ExecutionFlowUtils.getLastAssignment(flowDescription, columnsList);
    ASTNode possibleAssignment =
        ExecutionFlowUtils.getLastAssignment(flowDescription, possibleName);
    return columnsAssignment == possibleAssignment;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.ASTNode

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.