@Override
protected void internalPerform() throws AnalysisException {
TimeCounterHandle timeCounter = PerformanceStatistics.errors.start();
try {
RecordingErrorListener errorListener = new RecordingErrorListener();
ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
TypeProvider typeProvider = getContext().getTypeProvider();
//
// Validate the directives
//
validateDirectives(getContext(), source, unit, errorListener);
//
// Use the ConstantVerifier to verify the use of constants. This needs to happen before using
// the ErrorVerifier because some error codes need the computed constant values.
//
ConstantVerifier constantVerifier = new ConstantVerifier(
errorReporter,
libraryElement,
typeProvider);
unit.accept(constantVerifier);
//
// Use the ErrorVerifier to compute the rest of the errors.
//
ErrorVerifier errorVerifier = new ErrorVerifier(
errorReporter,
libraryElement,
typeProvider,
new InheritanceManager(libraryElement));
unit.accept(errorVerifier);
errors = errorListener.getErrorsForSource(source);
} finally {
timeCounter.stop();
}
}