CompileRequestorImpl requestor = new CompileRequestorImpl();
Compiler compiler = new Compiler(new NameEnvironmentImpl(unit),
DefaultErrorHandlingPolicies.proceedWithAllProblems(),
settings, requestor, new DefaultProblemFactory(
Locale.getDefault()));
compiler.compile(new ICompilationUnit[] { unit });
List problems = requestor.getProblems();
boolean error = false;
prob = new IProblem[problems.size()];
int errorCount = 0, warningCount = 0, count = 0;