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

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]);

AFAICanTell, you need to parser.setCompilerOptions and pass in the options to set source level to 1.5


/adam