Lines 49-54
Link Here
|
49 |
* char[] source = ...; |
49 |
* char[] source = ...; |
50 |
* ASTParser parser = ASTParser.newParser(AST.JLS3); // handles JDK 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 |
50 |
* ASTParser parser = ASTParser.newParser(AST.JLS3); // handles JDK 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 |
51 |
* parser.setSource(source); |
51 |
* parser.setSource(source); |
|
|
52 |
* // In order to parse 1.5 code, some compiler options need to be set to 1.5 |
53 |
* Map options = JavaCore.getOptions(); |
54 |
* options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); |
55 |
* options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5); |
56 |
* options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); |
57 |
* parset.setCompilerOptions(options); |
52 |
* CompilationUnit result = (CompilationUnit) parser.createAST(null); |
58 |
* CompilationUnit result = (CompilationUnit) parser.createAST(null); |
53 |
* </pre> |
59 |
* </pre> |
54 |
* Once a configured parser instance has been used to create an AST, |
60 |
* Once a configured parser instance has been used to create an AST, |