Problems with enums when building AST [message #1117726] |
Thu, 26 September 2013 19:00 |
j vl Messages: 5 Registered: September 2013 |
Junior Member |
|
|
Hi
When obtaining a compilation unit from the following basic enum:
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY;
}
The compilation unit doesn't contain anything and I get the following messages, from within the compilation unit.
Messages:
Syntax error on token "enum", interface expected
Syntax error on token ",", delete this token
I got this problem before and updated all my libraries to the most current being shipped with Eclipse Kepler, but the problem remains.
This is how I obtain the ompilation unit:
public static CompilationUnit GetCU(String path) {
ASTParser parser = ASTParser.newParser(AST.JLS4);
String f = null;
f = readFile(path);
parser.setSource(f.toCharArray());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
return (CompilationUnit) parser.createAST(null);
}
Any help, would be appreciated.
Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.04012 seconds