Lines 51-60
Link Here
|
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 |
52 |
* // In order to parse 1.5 code, some compiler options need to be set to 1.5 |
53 |
* Map options = JavaCore.getOptions(); |
53 |
* Map options = JavaCore.getOptions(); |
54 |
* options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); |
54 |
* JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options); |
55 |
* options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5); |
55 |
* parser.setCompilerOptions(options); |
56 |
* options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); |
|
|
57 |
* parset.setCompilerOptions(options); |
58 |
* CompilationUnit result = (CompilationUnit) parser.createAST(null); |
56 |
* CompilationUnit result = (CompilationUnit) parser.createAST(null); |
59 |
* </pre> |
57 |
* </pre> |
60 |
* Once a configured parser instance has been used to create an AST, |
58 |
* Once a configured parser instance has been used to create an AST, |
Lines 303-309
Link Here
|
303 |
} |
301 |
} |
304 |
|
302 |
|
305 |
/** |
303 |
/** |
306 |
* Sets the environment that can be used when no {@link IJavaProject} are available. |
304 |
* Sets the environment to be used when no {@link IJavaProject} is available. |
307 |
* |
305 |
* |
308 |
* <p>The user has to make sure that all the required types are included either in the classpath or source paths. |
306 |
* <p>The user has to make sure that all the required types are included either in the classpath or source paths. |
309 |
* All the paths containing binary types must be included in the <code>classpathEntries</code> whereas all paths containing |
307 |
* All the paths containing binary types must be included in the <code>classpathEntries</code> whereas all paths containing |
Lines 574-579
Link Here
|
574 |
* |
572 |
* |
575 |
* @param source the source string to be parsed, |
573 |
* @param source the source string to be parsed, |
576 |
* or <code>null</code> if none |
574 |
* or <code>null</code> if none |
|
|
575 |
* @see JavaCore#setComplianceOptions(String, Map) |
577 |
*/ |
576 |
*/ |
578 |
public void setSource(char[] source) { |
577 |
public void setSource(char[] source) { |
579 |
this.rawSource = source; |
578 |
this.rawSource = source; |