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();
prob = new IProblem[problems.size()];
int count = 0;
for (Iterator it = problems.iterator(); it.hasNext();) {