}
private <JS> CompilationUnitTree parseAndResolve(File inputFile, GenerationContext<JS> context, ClassLoader builtProjectClassLoader,
String sourceEncoding) {
JavaCompiler.CompilationTask task = null;
JavacTask javacTask = null;
try {
JavaCompiler compiler = getCompiler(builtProjectClassLoader, sourceEncoding);
Iterable<? extends JavaFileObject> fileObjects = fileManager.getJavaFileObjectsFromFiles(Collections.singleton(inputFile));
List<String> options = Arrays.asList("-proc:none");
task = compiler.getTask(null, classLoaderFileManager, null, options, null, fileObjects);
javacTask = (JavacTask) task;
context.setTrees(Trees.instance(javacTask));
context.setElements(javacTask.getElements());
context.setTypes(javacTask.getTypes());
Timers.start("parse-java");
CompilationUnitTree cu = javacTask.parse().iterator().next();
Timers.end("parse-java");
Timers.start("analyze-java");
javacTask.analyze();
Timers.end("analyze-java");
context.setCompilationUnit(cu);
return cu;