Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ASTParser.createAST()


      parser.setResolveBindings(true);
    parser.setStatementsRecovery((this.operation.reconcileFlags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
    parser.setBindingsRecovery((this.operation.reconcileFlags & ICompilationUnit.ENABLE_BINDINGS_RECOVERY) != 0);
    parser.setSource(this.workingCopy);
    parser.setIgnoreMethodBodies((this.operation.reconcileFlags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0);
    return (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(this.operation.progressMonitor);
  }
  return this.operation.makeConsistent(this.workingCopy);
}
/**
* Returns a resolved AST with {@link AST#JLS4 JLS4} level.
View Full Code Here


      parser.setResolveBindings(true);
    parser.setStatementsRecovery((this.operation.reconcileFlags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
    parser.setBindingsRecovery((this.operation.reconcileFlags & ICompilationUnit.ENABLE_BINDINGS_RECOVERY) != 0);
    parser.setSource(this.workingCopy);
    parser.setIgnoreMethodBodies((this.operation.reconcileFlags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0);
    return (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(this.operation.progressMonitor);
  }
  return this.operation.makeConsistent(this.workingCopy);
}
/**
* Returns the AST level requested by the reconcile operation.
View Full Code Here

    if (JavaProject.hasJavaNature(workingCopy.getJavaProject().getProject()))
      parser.setResolveBindings(true);
    parser.setStatementsRecovery((this.operation.reconcileFlags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
    parser.setBindingsRecovery((this.operation.reconcileFlags & ICompilationUnit.ENABLE_BINDINGS_RECOVERY) != 0);
    parser.setSource(workingCopy);
    return (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(this.operation.progressMonitor);   
  }
  return this.operation.makeConsistent(this.workingCopy);
}

/**
 
View Full Code Here

        ASTParser parser = ASTParser.newParser(AST.JLS3);
        parser.setKind(ASTParser.K_COMPILATION_UNIT);
        char[] input = readFile(inFile);
        parser.setSource(input);
        parser.setResolveBindings(true);
        CompilationUnit cu = (CompilationUnit) parser.createAST(null);
       
        // create a new JavaClass
        JavaClass cls = factory.createJavaClass();
        cls.setPlugin(plugin);
        cls.setPackage(pkg);
View Full Code Here

  // may have problem?!!
  public CompilationUnit getASTNode() {
    try {
      ASTParser parser = ASTParser.newParser(AST.JLS3);
      parser.setSource((ICompilationUnit) getJavaElement());
      return (CompilationUnit) parser.createAST(null);
    } catch (RuntimeException e) {
      e.printStackTrace();
      return null;
    }
  }
View Full Code Here

  private static CompilationUnit parse(ICompilationUnit unit) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    parser.setSource(unit);
    parser.setResolveBindings(true);
    return (CompilationUnit) parser.createAST(null); // parse
  }

  /**
   * Selection in the workbench has been changed. We
   * can change the state of the 'real' action here
View Full Code Here

  private static CompilationUnit parse(ICompilationUnit unit) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    parser.setSource(unit);
    parser.setResolveBindings(true);
    return (CompilationUnit) parser.createAST(null); // parse
  }

  /**
   * Selection in the workbench has been changed. We
   * can change the state of the 'real' action here
View Full Code Here

  private static CompilationUnit parse(ICompilationUnit unit) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    parser.setSource(unit);
    parser.setResolveBindings(true);
    return (CompilationUnit) parser.createAST(null); // parse
  }

  /**
   * Selection in the workbench has been changed. We
   * can change the state of the 'real' action here
View Full Code Here

    final Set<JavaElement> set = new HashSet<JavaElement>();

    final ASTParser parser = ASTParser.newParser(AST.JLS4);
    parser.setResolveBindings(true);
    parser.setSource(JavaCore.createCompilationUnitFrom(javaFile));
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      @Override
      public boolean visit(final ClassInstanceCreation node) {
        final ITypeBinding ntb = node.resolveTypeBinding();
View Full Code Here

    final List<IVariableBinding> list = new ArrayList<IVariableBinding>();

    final ASTParser parser = ASTParser.newParser(AST.JLS4);
    parser.setResolveBindings(true);
    parser.setSource(JavaCore.createCompilationUnitFrom(javaFile));
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      @Override
      public boolean visit(final ClassInstanceCreation node) {
        ITypeBinding ntb = node.resolveTypeBinding();
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.