[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: JDT Builder and AST content

The DOM AST is not based on the build state. One can create an AST without ever building.

For your specific problem, it sounds like you're attempting to build the AST on a source that is not yet up-to-date.

Jerome

Julien Canches wrote:
Julien Canches a écrit :


ICompilationUnit compilationUnitOfB; ASTParser parser = ASTParser.newParser(AST.JLS2); parser.setSource(compilationUnitOfB); parser.setResolveBindings(true); CompilationUnit ASTNode = (CompilationUnit)parser.createAST(null); IProblem[] problems=ASTNode.getProblems();


I forgot to mention that compilationUnitOfB is obtained like this:
IFile sourceFile; // B.java
ICompilationUnit compilationUnitOfB = (ICompilationUnit) JavaCore.create(sourceFile);