ICompilationUnit cu = createCompilationUnit(source, fileName);
CompilationResult compilationResult = createDefaultCompilationResult(cu, options);
JavaCompilation javaCompilation = new JavaCompilation(parser.parse(cu, compilationResult), parser.scanner);
if (compilationResult.hasSyntaxError) {
throw new InvalidSyntaxException(new String(compilationResult.getFileName()), compilationResult.toString());
}
return javaCompilation;
}