[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Full Java 1.5 ASTParser

Nope.  Switched to RC1 and I am still getting the error.

Andrew Eisenberg wrote:
Hi Olivier,

Thanks for your reply. Here is a situation that I am talking about. This is the source I am trying to parse:

@Init class X {
  int y;
}

Here is the code snippet I am running:

ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource("@Init class X { int y; }".toCharArray());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
CompilationUnit rootAST = (CompilationUnit) parser.createAST(null);
System.out.println(rootAST.getProblems()[0]);



The output is:

Pb(596) Syntax error, annotations are only available if source level is 5.0

Once again, I am using 3.1M6 on Windows XP.  Is this problem fixed in RC1?

thanks,
--andrew

Olivier Thomann wrote:

Andrew Eisenberg a écrit :

I am using Eclipse 3.1M6. I would like to use the DOM api to parse Java 1.5 code. However, it seems that the ASTParse in 3.1M6 cannot parse Java 1.5. Does a more recent version of eclipse have a full Java 1.5 parser?


The DOM ASTParser in RC1 can parse any 1.5 source code.
If you find an example that doesn't work, let us know by opening a bug report against JDT/Core with steps to reproduce.
--
Olivier