認真讀文檔!
認真讀文檔!
認真讀文檔!
血的教訓....
// ignored some codes ...
Map options = JavaCore.getOptions();
JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options);
parser.setCompilerOptions(options);
- Which compiler options to use.
This is especially important to use if the parsing/scanning of the source code requires a different version than the default of the workspace.
For example, the workspace defaults are 1.4 and you want to create an AST for a source code that is using 1.5 constructs.
References
Eclipse JDT ASTParser convert enum declaration node incorrectly