Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse()


      if (searchPosition < 0 || searchPosition > source.length) {
        // the position is out of range. There is no need to search for a node.
        return compilationUnitDeclaration;
      }

      compilationUnitDeclaration.traverse(nodeSearcher, compilationUnitDeclaration.scope);

      org.eclipse.jdt.internal.compiler.ast.ASTNode node = nodeSearcher.found;
      if (node == null) {
        return compilationUnitDeclaration;
      }
View Full Code Here


    @Override
    public JavaStructureNode createStructureTree() {
        CompilationUnitDeclaration cu = fCompilation.getCompilationUnit();
        JavaStructureNode node = new JavaStructureNode(Type.CU, null, null, cu);
        cu.traverse(new JavaStructureTreeBuilder(node), (CompilationUnitScope) null);
        return node;
    }

    @Override
    public EntityType convertType(JavaStructureNode node) {
View Full Code Here

    private JavaStructureNode createStructureTree(String source) {
        JavaCompilation compilation = CompilationUtils.compileSource(source);
        CompilationUnitDeclaration cu = compilation.getCompilationUnit();
        JavaStructureNode root = new JavaStructureNode(Type.CU, null, null, cu);
        cu.traverse(new JavaStructureTreeBuilder(root), (CompilationUnitScope) null);
        return root;
    }

    private void createDifferences() {
        StructureDifferencer differencer = new StructureDifferencer();
View Full Code Here

    private void createStructureTree() {
        JavaCompilation compilation = CompilationUtils.compileSource(fSnippet);
        CompilationUnitDeclaration cu = compilation.getCompilationUnit();
        fRoot = new JavaStructureNode(Type.CU, null, null, cu);
        cu.traverse(new JavaStructureTreeBuilder(fRoot), (CompilationUnitScope) null);
    }

    private String getCompilationUnit(String snippet) {
        return "class Clazz { " + snippet + " }";
    }
View Full Code Here

      if (searchPosition < 0 || searchPosition > source.length) {
        // the position is out of range. There is no need to search for a node.
        return compilationUnitDeclaration;
      }

      compilationUnitDeclaration.traverse(nodeSearcher, compilationUnitDeclaration.scope);

      org.eclipse.jdt.internal.compiler.ast.ASTNode node = nodeSearcher.found;
      if (node == null) {
        return compilationUnitDeclaration;
      }
View Full Code Here

      // Find references to type in units that aren't valid.
      //
      for (Iterator iter = cudsByFileName.values().iterator(); iter.hasNext();) {
        CompilationUnitDeclaration cud = (CompilationUnitDeclaration) iter.next();
        cud.traverse(trv, cud.scope);
      }
    } while (!pendingRemovals.isEmpty());
  }

  private static void removeUnitsWithErrors(TreeLogger logger,
View Full Code Here

    //
    final CacheManager.Mapper identityMapper = cacheManager.getIdentityMapper();
    for (Iterator iter = cudsByFileName.values().iterator(); iter.hasNext();) {
      CompilationUnitDeclaration cud = (CompilationUnitDeclaration) iter.next();

      cud.traverse(new ASTVisitor() {
        public boolean visit(TypeDeclaration typeDecl, BlockScope scope) {
          JClassType enclosingType = identityMapper.get((SourceTypeBinding) typeDecl.binding.enclosingType());
          processType(typeDecl, enclosingType, true);
          return true;
        }
View Full Code Here

      String processing = "Processing types in compilation unit: " + loc;
      final TreeLogger cudLogger = logger.branch(TreeLogger.SPAM, processing,
          null);
      final char[] source = cud.compilationResult.compilationUnit.getContents();

      cud.traverse(new ASTVisitor() {
        public boolean visit(TypeDeclaration typeDecl, BlockScope scope) {
          if (!resolveTypeDeclaration(cudLogger, source, typeDecl)) {
            String name = String.valueOf(typeDecl.binding.readableName());
            String msg = "Unexpectedly unable to fully resolve type " + name;
            logger.log(TreeLogger.WARN, msg, null);
View Full Code Here

    // Find references to type in units that aren't any longer valid.
    //
    for (Iterator iter = cudsByFileName.values().iterator(); iter.hasNext();) {
      CompilationUnitDeclaration cud = (CompilationUnitDeclaration) iter.next();
      cud.traverse(trv, cud.scope);
    }

    Set toTraverse = new HashSet(changedFiles);
    for (Iterator iter = toTraverse.iterator(); iter.hasNext();) {
      String fileName = (String) iter.next();
View Full Code Here

          return false;
        return super.visit(arrayReference, blockScope);
      }
    }
    CaptureFinder captureFinder = new CaptureFinder();
    outerParsedUnit.traverse(captureFinder, outerParsedUnit.scope);
    this.typeBinding = captureFinder.capture;
  }

  public void consumeException() {
    this.types = new ArrayList();
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.